2011年9月27日 上午10:22:39 org.apache.catalina.core.StandardWrapperValve invoke
嚴重的: Servlet.service() for servlet test threw exception
org.hibernate.hql.ast.QuerySyntaxException: country is not mapped [from country]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:181)
at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:111)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:93)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:314)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3355)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3239)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:726)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:294)
哦这个是血的教训,白白的浪费了那么多时间,
楸的我眼疼
本文记录了一次使用Hibernate处理HQL查询时遇到的严重错误:在尝试查询未映射的实体属性时引发的QuerySyntaxException异常。通过分析异常堆栈跟踪,可以发现错误发生在尝试从未映射的country实体获取属性时。
2151

被折叠的 条评论
为什么被折叠?



