Hibernate用到HQL查询时的错误

Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: student is not mapped [from student]

研究了一下发现,原来是HQL查询是基于持久化类查询,而不是基于数据库,我的数据库表是student,而类是Student,所以就出错了,正确应该是from Student

posted @ 2017-06-02 16:09  镜湖月色  阅读(335)  评论(2编辑  收藏  举报