org.hibernate.hql.internal.ast.QuerySyntaxException: user is not mapped [from user] at org.hibernat
代码:
EntityManager em = SpringBeanUtils.getBean(EntityManager.class);
Query query = em.createQuery("select id from user");
return query.getResultList();
解决:
HQL中的应写对应的类名,而不是数据库名
@Entity(name = "ormuser")
Query query = em.createQuery("select id from ormuser");