我想知道为什么我得到了QuerySyntaxException: [Entity] is not mapped
,尽管 Hibernate 正在记录
INFO Hibernate EntityManager 3.5.0-Final
...
INFO Binding entity from annotated class: products.model.ProductGroup
INFO Bind entity products.model.ProductGroup on table GRP
...
INFO table found: GRP
INFO columns: [grp, name, top]
实体类看起来像
@Entity(name="GRP")
public class ProductGroup implements IdentifiableEntity {
@Id
private String grp;
private String name;
private String top;
...
}
在这一行抛出错误:
Query q = em.createQuery("select g from ProductGroup g");
都是 JPA,没有 Hibernate API。