Hibernate查询报错:org.hibernate.hql.internal.ast.QuerySyntaxException: XXX is not mapped
2017-10-16 22:55
549 查看
这个错误的产生原因是,hibernate执行查询的语句hql是面向对象的查询,而不是面向数据库表的查询,因此在hql语句中的对象名必须与实体类的类名一致,严格区分大小写。
如实体类为 Car,则hql语句中应该为:
而不能随意写成
如实体类为 Car,则hql语句中应该为:
SELECT c.price FROM Car c
而不能随意写成
SELECT c.price FROM car c或
SELECT c.price FROM CAR c
相关文章推荐
- org.hibernate.hql.internal.ast.QuerySyntaxException: XXX is not mapped [from XXX]
- 使用hibernate的hql语句做查询报错 org.hibernate.hql.internal.ast.QuerySyntaxException: user is not mapped
- org.hibernate.hql.ast.QuerySyntaxException: XXX is not mapped [from XXX]
- org.hibernate.hql.ast.QuerySyntaxException: xxx is not mapped [from xxx]
- exception is org.hibernate.hql.internal.ast.QuerySyntaxException: Driver is not mapped...的坑
- 出现org.hibernate.hql.internal.ast.QuerySyntaxException: goodsinfo is not mapped [from goodsinfo错误
- org.hibernate.hql.internal.ast.QuerySyntaxException: XXXXis not mapped [from XXXX]
- org.hibernate.hql.internal.ast.QuerySyntaxException: users is not mapped
- 异常收集-org.hibernate.hql.internal.ast.QuerySyntaxException: activityinfo is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: Admin is not mapped [from Admin where username=
- org.hibernate.hql.internal.ast.QuerySyntaxException: FwbzItem is not mapped
- SSH整合报错:org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped[......]
- org.hibernate.hql.internal.ast.QuerySyntaxException: Exam is not mapped
- Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: table is not Mapped问题解决
- org.hibernate.hql.internal.ast.QuerySyntaxException: appUser is not mapped
- org.hibernate.hql.ast.QuerySyntaxException: xxx is not mapped [from xxx]
- org.hibernate.hql.internal.ast.QuerySyntaxException: persons is not mapped...
- org.hibernate.hql.ast.QuerySyntaxException: xxx is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: USER is not mapped 报错解决
- Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Student is not mapped