org.springframework.orm.hibernate3.HibernateQueryException:employees is not mapped

异常记录:org.springframework.orm.hibernate3.HibernateQueryException:employees is not mapped [from employees where name ='xiao' and employee_id=100001 ];

知识点:HQL语句中,from 后跟的是映射的实体类名,而非数据库中的表名。

 

解决:

from employees;  employees是表名,而非实体对象名,原因在此!!

修改为实体类名 from Employee where name ='xiao' and employee_id=100001

posted @ 2018-06-12 16:23  sq_1303037035  阅读(3289)  评论(0编辑  收藏  举报