hibernate错误 xx is not mapped [from xxx]

来源:互联网 发布:七天网络手机阅卷 编辑:程序博客网 时间:2024/06/06 18:08

出现这个错误的原因就是用的hibernate HQL语法查询的问题


其中查询的是POJO对象,而不是table


 sessionFactory.getCurrentSession().createQuery("from t_role");  <----这是错误的 t_role是表名



 sessionFactory.getCurrentSession().createQuery("from Role");<----Role是类名

阅读全文
0 0
原创粉丝点击