org.hibernate.hql.ast.QuerySyntaxException: INVOICE is not mapped [from INVOICE]

转载 2016年06月01日 14:36:03

使用hibernate的hql语句报错:


org.hibernate.hql.ast.QuerySyntaxException: INVOICE is not mapped [from INVOICE]


原因比较简单,只要在实体类中增加映射注释-实体和表的映射 

@Entity(name = "表名")


1有问题的

@Entity
@SuppressWarnings("serial")
@Table(name = "INVOICE")
public class Invoice implements java.io.Serializable {

2正常的

@Entity(name = "INVOICE")
@SuppressWarnings("serial")
@Table(name = "INVOICE")
public class Invoice implements java.io.Serializable {


但是,涉及到多表查询的时候hql查询就无效了,这个时候报这种错误就只能更换为sql语句了



相关文章推荐

org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]

http://669341085.iteye.com/blog/858572 org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped...

org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User] 异常总结

异常如下:org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]  at org.hibernate.h...

org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX]

org.hibernate.hql.ast.QuerySyntaxException: XX is not mapped [from XX] 解决办法: 1.看是否忘记将hibernate的映射文...

org.hibernate.hql.internal.ast.QuerySyntaxException: userinfo is not mapped [from userinfo u where u

org.hibernate.hql.internal.ast.QuerySyntaxException:userinfo is not mapped [from userinfo u where u....

Hibernate异常: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]

Hibernate异常:org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]1、出现该错误的情况分析1,...

nested exception is org.hibernate.hql.ast.QuerySyntaxException: users is not mapped. [from users]

在使用hibernate时,出现了以上异常:
  • fcytxdy
  • fcytxdy
  • 2014年05月17日 10:34
  • 2808

org.hibernate.hql.ast.QuerySyntaxException: UserType is not mapped

报错代码: main.java.com.aosa.app.base.exception.ASSystemDaoException: class main.java.com.aosa.orm.hi...
  • TodayMZ
  • TodayMZ
  • 2013年05月22日 08:54
  • 3040

org.hibernate.hql.internal.ast.QuerySyntaxException: appUser is not mapped

org.hibernate.hql.internal.ast.QuerySyntaxException: appUser is not mapped [from appUser t where t.l...
  • whqcfp
  • whqcfp
  • 2016年09月03日 12:36
  • 244

Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: table is not Mapped问题解决

引言: 在基于SpringData/JPA来快速开发若干功能过程中,碰到了table is not Mapped问题,经过一番辛苦的调试测试之后,才发现了一个@Entity的属性name的妙用。...

org.hibernate.hql.ast.QuerySyntaxException: is not mapped 异常总结

org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select u from User u where u.userNam...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:org.hibernate.hql.ast.QuerySyntaxException: INVOICE is not mapped [from INVOICE]
举报原因:
原因补充:

(最多只允许输入30个字)