我有一堂课:
@Entity
public class Resume {
private Long id;
@Embedded
private DesiredPositionAndSalary desiredPositionAndSalary;
}
和类:
@Embeddable
public class DesiredPositionAndSalary {
@ManyToMany
private Set<Specialization> specializations;
}
和类;)
@Entity
public class Specialization {
private Long id;
}
现在我有一些我需要过滤的专业。例如,我需要选择具有程序员或经理等专业之一的所有简历。就像是
select * from resume r inner join resume_to_specialization rts on r.id = rts.id inner join specialization s on rts.spec_id in(1,2)
我如何在 Criteria api 中编写此查询?如果我错过了一些主要细节,我可以提供更多。