我有简单的实体如下:建议.java:@Entitypublic class Suggestion { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @OneToOne private Employee author; @OneToMany @JoinColumn(name = "recipients_id") private List<Employee> recipients;}和 Employee.java:@Entitypublic class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private String name;}我想在控制器的所有返回suggestions包含只有一个员工id在recipients列表中。是否可以避免自定义查询(本机查询)?我试过:findByRecipientsContains(id) 或findByRecipientsContaining(id)但没有运气...
添加回答
举报
0/150
提交
取消