org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]
2014-05-22 09:20
435 查看
org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]
解决办法:
1.看是否忘记将hibernate的映射文件添加到Hibernate.cfg.xml(使用Hibernate时)或者applicationContext.xml中
2.检查表中的字段和映射文件中的字段是否一一对应
3.检查字段名是否使用了数据库中的关键字
4.例如:
下面的Hql语句
from User
其中的user不是表的名字,而是实体类的类名
解决办法:
1.看是否忘记将hibernate的映射文件添加到Hibernate.cfg.xml(使用Hibernate时)或者applicationContext.xml中
2.检查表中的字段和映射文件中的字段是否一一对应
3.检查字段名是否使用了数据库中的关键字
4.例如:
下面的Hql语句
from User
其中的user不是表的名字,而是实体类的类名
相关文章推荐
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped
- org.hibernate.hql.ast.QuerySyntaxException:XX is not mapped
- Hibernate中运行程序时报错:org.hibernate.hql.internal.ast.QuerySyntaxException: apibasic is not mapped [from
- org.hibernate.hql.ast.QuerySyntaxException per is not mapped [from Per as p]
- hibernate错误:org.hibernate.hql.ast.QuerySyntaxException: emp is not mapped [from emp]
- SSH整合报错:org.hibernate.hql.ast.QuerySyntaxException: userinfo is not mapped [from userinfo]
- 异常:org.hibernate.hql.ast.QuerySyntaxException: EmpModel is not mapped [from EmpModel where name = ?
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped hibernate 注解出错
- SSH出错--hibernate--org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- org.hibernate.hql.internal.ast.QuerySyntaxException: Admin is not mapped [from Admin where username=
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- spring&org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped !
- org.hibernate.hql.ast.QuerySyntaxException: Category is not mapped [from Category]
- org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped !
- SSH报错:org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select o from User o where 1=1
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User] 异常总结