[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2648?page=c...
]
Diego Pires Plentz resolved HHH-2648.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
NPE in FromClause.java
----------------------
Key: HHH-2648
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2648
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.1
Environment: JBoss 4.2, JDK 1.5
Reporter: Heiko W. Rupp
Assignee: Diego Pires Plentz
This JPA Query
query="SELECT m " +
"FROM MeasurementDataTrait AS m " +
"WHERE m.schedule.resource.id = :resourceId" +
" AND m.schedule.definition.displayType = :displayType " +
" AND m.id.timestamp = (" +
" SELECT MAX(mdt.id.timestamp) " +
" FROM MeasurementDataTrait AS mdt" +
" WHERE m.scheduleId = mdt.scheduleId" +
" )" +
" GROUP BY m " +
" ORDER BY m.id.timestamp DESC"
Results in this NPE:
java.lang.NullPointerException
at
org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements(FromClause.java:120)
at org.hibernate.hql.ast.tree.FromClause.getFromElement(FromClause.java:107)
at
org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:81)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:255)
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.exprOrSubquery(HqlSqlBaseWalker.java:4049)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3528)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1690)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
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)
When I remove the subselect, then the query gets parsed nicely.
--
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