[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5537?page=c...
]
Wilhelm Kleu commented on HHH-5537:
-----------------------------------
Apologies. Can someone please edit the summary to say: NPE when accessing composite id of
derived property in hql.
NPE when access
---------------
Key: HHH-5537
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5537
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.5
Environment: Hibernate version: 3.5.5
Database: Oracle 10g, hsqldb (Test case is for hsqldb)
Reporter: Wilhelm Kleu
Attachments: hibernate-hql-bug.zip
The test case has an entity (Person) with a derived property that maps to another entity
(Alias) using a specific formula.
This other entity has a composite key.
When retrieving Person everything seems to map correctly on the object.
A NullPointerException is thrown when using the id of the the derived property in a HQL
query:
{quote}
java.lang.NullPointerException
at
org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:103)
at
org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:62)
at
org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1443)
at org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:354)
at org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:323)
at org.hibernate.hql.ast.tree.FromElement.toColumns(FromElement.java:491)
at org.hibernate.hql.ast.tree.DotNode.getColumns(DotNode.java:133)
at org.hibernate.hql.ast.tree.DotNode.initText(DotNode.java:252)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:246)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:117)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:113)
at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:868)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1323)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4387)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3860)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1909)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:824)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:610)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:294)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:237)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760)
at com.example.Tests.testReportedBug(Tests.java:48)
{quote}
I attached a simple test case that shows the exception being thrown. See: Tests.java
--
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