我有以下
@Entity
@Table(name = "PROJECTS")
public class Project implements Serializable {
@Id
private Integer SlNo;
@Id
private Long projectNo;
private Date projectDate;
}
在 DAO 类中
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> countQ = cb.createQuery(Long.class);
Root<Project> empCount = countQ.from(Project.class);
countQ.select(cb.count(empCount));
TypedQuery<Long> countquery = entityManager.createQuery(countQ);// error in this line
我java.lang.IllegalStateException: No supertype found
在上面的行中遇到了异常。如何解决或解决此问题?貌似有bug,请问有解决办法吗?
我在用Hibernate 4.1.0.Final