请帮助解决此类问题-有一个父类
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "type")
public abstract class Parent {
@Id
@GeneratedValue
protected Long id;
private String type;
}
和子班
@Entity
@DiscriminatorValue("type1")
public class Child1 extends Parent {
private String field1;
}
@Entity
@DiscriminatorValue("type2")
public class Child2 extends Parent {
private String field2;
}
如何使用Criteria API加入这三个实体?我们使用Hibernate v4.3.11.Final,JPA 2.1。谢谢!