2
기준 값 API를 사용하여 검색 값에서 입력을 가져 와서 엔티티를 선택하려고합니다. 문서에 수신자가 더 많을 수 있습니다. 받는 사람은 많은 서브 클래스Java Hibernate Criteria 하위 클래스 선택
@Entity
public class Document implements Serializable {
@OneToMany(mappedBy="document")
private List<Recipient> recipients = new ArrayList<Recipient>();
@Entity
public class RecipientAccount extends Recipient {
String name;
을 가지고 어떻게 특정 이름을 가진 ReciepientAccount있는 모든 문서를 선택할 수 있습니다? 모든 하위 클래스를 검색하고 OR로 연결해야합니다. 우아한 방법이 있습니까?
인사 m
당신이 뭔가를 시도 –
주석이 달린 모델 클래스를 추가하십시오 그것은 작동하지 않았다? – maksimov
도움이 될 수도 있습니다 - (링크) (http://stackoverflow.com/questions/2252468/hibernate-criteria-and-multiple-join) –