0
我有一個類:如何創建標準API查詢
@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中編寫此查詢?如果我想念一些重要細節,我可以給予更多。