0
發現我有以下java.lang.IllegalStateException:沒有超上查詢
@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