org.hibernate.hql.ast.QuerySyntaxException:user is notmapped
2011-04-24 16:29
549 查看
org.hibernate.hql.ast.QuerySyntaxException:user is notmapped
唉,这么个问题困扰了好长时间,经查找资料发现是由于对hibernate的了解不深刻,我的查询语句是"from user u where u.username=?",因为Hibernate是对类查询的 ,所以在这里的HQL语言要面向对象 User.java 进行操作,把user改成User就可以了。
发现这个问题要感谢 自由呼吸 ,他的博客http://hi.baidu.com/kaisep/blog/item/1146cec8e7f528107e3e6f63.html
唉,这么个问题困扰了好长时间,经查找资料发现是由于对hibernate的了解不深刻,我的查询语句是"from user u where u.username=?",因为Hibernate是对类查询的 ,所以在这里的HQL语言要面向对象 User.java 进行操作,把user改成User就可以了。
发现这个问题要感谢 自由呼吸 ,他的博客http://hi.baidu.com/kaisep/blog/item/1146cec8e7f528107e3e6f63.html
相关文章推荐
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User] 异常总结
- is not mapped.nested exception is org.hibernate.hql.ast.QuerySyntaxException: user_kissfly
- SSH报错:org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select o from User o where 1=1
- org.hibernate.hql.internal.ast.QuerySyntaxException: user is not mapped
- org.hibernate.hql.ast.QuerySyntaxException: UserType is not mapped
- Hibernate异常: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- SSH整合报错:org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped[......]
- 使用hibernate的hql语句做查询报错 org.hibernate.hql.internal.ast.QuerySyntaxException: user is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: USER is not mapped 报错解决
- SSH出错--hibernate--org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- org.hibernate.hql.internal.ast.QuerySyntaxException: userinfo is not mapped [from userinfo u where u
- 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=
- SSH整合报错:org.hibernate.hql.ast.QuerySyntaxException: userinfo is not mapped [from userinfo]
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User] 异常总结
- Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- org.hibernate.hql.internal.ast.QuerySyntaxException: appUser is not mapped
- org.hibernate.hql.ast.QuerySyntaxException: xxx is not mapped
- Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: table is not Mapped问题解决