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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM