当前位置: 代码迷 >> Java相关 >> org.hibernate.hql.ast.QuerySyntaxException: TInvProd is
  详细解决方案

org.hibernate.hql.ast.QuerySyntaxException: TInvProd is

热度:6441   发布时间:2013-02-25 21:51:04.0
hibernate的问题?
谁知道 怎么 改啊 什么错误
org.hibernate.hql.ast.QuerySyntaxException: TInvProd is not mapped [from TInvProd as s ]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:265)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.anrui.pis.impsp.ShallDAO.getAllTInvProd(ShallDAO.java:62)
at com.anrui.pis.managers.impl.erwin.vv.main(vv.java:14)
Exception in thread "main" java.lang.NullPointerException
at com.anrui.pis.managers.impl.erwin.vv.main(vv.java:15)


------解决方案--------------------------------------------------------
TInvProd 这个类 并没有和相应的表建立映射关系吧

你的TInvProd.hbm.xml 文件呢

------解决方案--------------------------------------------------------
探讨
TInvProd 这个类 并没有和相应的表建立映射关系吧

你的TInvProd.hbm.xml 文件呢

------解决方案--------------------------------------------------------
TInvProd在hibernate的配置文件中找不到映射xml文件或class文件,也有可能在hibernate的配置文件中没有配置这个内容。
  相关解决方案