Property of EmbeddedId could not be resolved
--------------------------------------------
Key: EJBTHREE-1179
URL:
http://jira.jboss.com/jira/browse/EJBTHREE-1179
Project: EJB 3.0
Issue Type: Bug
Affects Versions: AS 4.2.2.GA
Reporter: Marco Ladermann
An @EmbeddeID annotated class has a setter "setTId(long tId)" (with uppercase
"I") and a getter "long getTId()" (with uppercase "I")
generated by HibernateTools that refer to a column "T_ID" in the backing table.
When querying for this property, as in "select tdd.id.tId from
de.dpa.plato.ejb.view.VrTerminLdpadienst tdd where tdd.id.dpadienstKuerzel =
'lni" an exception is thrown: "org.hibernate.QueryException: could not
resolve property: id.tId". The same (except for the changed naming) query works fine,
if the getter and setter are renamed to "setTerminId(long tId)" and
"getTerminId()".
Here the stacktrace (the above query is here a subquery):
Testcase: find(de.dpa.plato.ejb.session.SearchControllerTest): Caused an ERROR
java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve
property: id.tId of: de.dpa.plato.ejb.view.VrTerminLdpadienst [select object(t)
from de.dpa.plato.ejb.view.VTerminRechercheBasis t where 1=1
and (t.id in (select rts.id.terminId from
de.dpa.plato.ejb.view.VrTerminStaat rts where rts.id.staatId = '1') or
t.postadresseStaatId = '1')
and t.dpabueroKuerzel <> 'WVO'
and t.id in (select tdd.id.tId from
de.dpa.plato.ejb.view.VrTerminLdpadienst tdd where tdd.id.dpadienstKuerzel =
'lni')
and (t.id in (select r.terminId from
de.dpa.plato.ejb.view.VrTerminRedakteur r, de.dpa.plato.ejb.view.VlDpamitarbeiterRecherche
ma where r.redakteurId = ma.id and ma.kuerzel = 'hoe'))
and t.istKopie = 0
and
t.istInitiativ = 0 and ( 1=0
or
t.startzeitpunktTag >= to_date('01.01.2008',
'DD.MM.YYYY')
)
order by decode(t.startzeitpunktTag,null,2,1), t.startzeitpunktTag,
t.startzeitpunktOhneUhrzeit, t.startzeitpunkt, t.postadresseOrt, t.titel, t.id]
javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException:
could not resolve property: id.tId of: de.dpa.plato.ejb.view.VrTerminLdpadienst [select
object(t)
from de.dpa.plato.ejb.view.VTerminRechercheBasis t where 1=1
and (t.id in (select rts.id.terminId from
de.dpa.plato.ejb.view.VrTerminStaat rts where rts.id.staatId = '1') or
t.postadresseStaatId = '1')
and t.dpabueroKuerzel <> 'WVO'
and t.id in (select tdd.id.tId from
de.dpa.plato.ejb.view.VrTerminLdpadienst tdd where tdd.id.dpadienstKuerzel =
'lni')
and (t.id in (select r.terminId from
de.dpa.plato.ejb.view.VrTerminRedakteur r, de.dpa.plato.ejb.view.VlDpamitarbeiterRecherche
ma where r.redakteurId = ma.id and ma.kuerzel = 'hoe'))
and t.istKopie = 0
and
t.istInitiativ = 0 and ( 1=0
or
t.startzeitpunktTag >= to_date('01.01.2008',
'DD.MM.YYYY')
)
order by decode(t.startzeitpunktTag,null,2,1), t.startzeitpunktTag,
t.startzeitpunktOhneUhrzeit, t.startzeitpunkt, t.postadresseOrt, t.titel, t.id]
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:193)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:105)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
at $Proxy59.find(Unknown Source)
at
de.dpa.plato.ejb.session.SearchControllerTest.find(SearchControllerTest.java:49)
Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not
resolve property: id.tId of: de.dpa.plato.ejb.view.VrTerminLdpadienst [select object(t)
from de.dpa.plato.ejb.view.VTerminRechercheBasis t where 1=1
and (t.id in (select rts.id.terminId from
de.dpa.plato.ejb.view.VrTerminStaat rts where rts.id.staatId = '1') or
t.postadresseStaatId = '1')
and t.dpabueroKuerzel <> 'WVO'
and t.id in (select tdd.id.tId from
de.dpa.plato.ejb.view.VrTerminLdpadienst tdd where tdd.id.dpadienstKuerzel =
'lni')
and (t.id in (select r.terminId from
de.dpa.plato.ejb.view.VrTerminRedakteur r, de.dpa.plato.ejb.view.VlDpamitarbeiterRecherche
ma where r.redakteurId = ma.id and ma.kuerzel = 'hoe'))
and t.istKopie = 0
and
t.istInitiativ = 0 and ( 1=0
or
t.startzeitpunktTag >= to_date('01.01.2008',
'DD.MM.YYYY')
)
order by decode(t.startzeitpunktTag,null,2,1), t.startzeitpunktTag,
t.startzeitpunktOhneUhrzeit, t.startzeitpunkt, t.postadresseOrt, t.titel, t.id]
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:634)
at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
at
org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:127)
at
org.jboss.seam.persistence.EntityManagerProxy.createQuery(EntityManagerProxy.java:79)
at de.dpa.plato.ejb.session.SearchController.find(SearchController.java:139)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110)
at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at
org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at
org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:116)
at
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
Caused by: org.hibernate.QueryException: could not resolve property: id.tId of:
de.dpa.plato.ejb.view.VrTerminLdpadienst [select object(t)
from de.dpa.plato.ejb.view.VTerminRechercheBasis t where 1=1
and (t.id in (select rts.id.terminId from
de.dpa.plato.ejb.view.VrTerminStaat rts where rts.id.staatId = '1') or
t.postadresseStaatId = '1')
and t.dpabueroKuerzel <> 'WVO'
and t.id in (select tdd.id.tId from
de.dpa.plato.ejb.view.VrTerminLdpadienst tdd where tdd.id.dpadienstKuerzel =
'lni')
and (t.id in (select r.terminId from
de.dpa.plato.ejb.view.VrTerminRedakteur r, de.dpa.plato.ejb.view.VlDpamitarbeiterRecherche
ma where r.redakteurId = ma.id and ma.kuerzel = 'hoe'))
and t.istKopie = 0
and
t.istInitiativ = 0 and ( 1=0
or
t.startzeitpunktTag >= to_date('01.01.2008',
'DD.MM.YYYY')
)
order by decode(t.startzeitpunktTag,null,2,1), t.startzeitpunktTag,
t.startzeitpunktOhneUhrzeit, t.startzeitpunkt, t.postadresseOrt, t.titel, t.id]
at
org.hibernate.persister.entity.AbstractPropertyMapping.throwPropertyException(AbstractPropertyMapping.java:43)
at
org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:63)
at
org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:31)
at
org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1304)
at org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:315)
at org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:290)
at org.hibernate.hql.ast.tree.FromElement.toColumns(FromElement.java:390)
at org.hibernate.hql.ast.tree.DotNode.getColumns(DotNode.java:97)
at org.hibernate.hql.ast.tree.DotNode.initText(DotNode.java:212)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:191)
at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(DotNode.java:139)
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:459)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.propertyRef(HqlSqlBaseWalker.java:1080)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1881)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1825)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1394)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:553)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.collectionFunctionOrSubselect(HqlSqlBaseWalker.java:4253)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.inRhs(HqlSqlBaseWalker.java:4161)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3842)
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.logicalExpr(HqlSqlBaseWalker.java:1687)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
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)
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
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira