[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1319?page=c...
]
Gareth Chapman commented on HHH-1319:
-------------------------------------
This recently caught me out too. Is there a plan to generate a more meaningful error?
Hibernate 3.1 does not analyze queries with a certain depth anymore
-------------------------------------------------------------------
Key: HHH-1319
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1319
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.1
Environment: Linux, jdk 1.5, Hibernate 3.1, Oracle 10g
Reporter: Erik Heckert
Attachments: testcase.tar
A query like the one
from Dispo.Hibernate.Test.A as a where a.ptrB.ptrC.Oid >= :oid
leads to a NullPointerException when using Hibernate 3.1. The same query runs without a
problem against Hibernate 3.0.5.
When breaking down the where clause to "a.ptrB.Oid = ptrC.Oid and ptrC.Oid =
:oid" the query works.
The stack trace is:
[java] java.lang.NullPointerException
[java] at org.hibernate.hql.ast.tree.DotNode.getColumns(DotNode.java:97)
[java] at org.hibernate.hql.ast.tree.DotNode.initText(DotNode.java:210)
[java] at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:204)
[java] at
org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
[java] at
org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
[java] at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:660)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1213)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4022)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3628)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1756)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:774)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:575)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:279)
[java] at
org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:227)
[java] at
org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
[java] at
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
[java] at
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105)
[java] at
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:74)
[java] at
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:53)
[java] at
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
[java] at
org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:108)
[java] at
org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:88)
[java] at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1540)
[java] at Dispo.Hibernate.Test.QueryABC.main(QueryABC.java:32)
I'll attach the Java files I've used for this test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira