Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toplink issues with Entities in the Ids

 
Sean Brown
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that when using entities with composite IDs in association with the @Ids of an Entity, Toplink runs into many problems.
Although I could (and hope to) be wrong about this, there is some evidence.

The error message thrown is:
Exception Description: The parameter name [itemname] in the query's selection criteria does not match any parameter name defined in the query.

Where "itemname" is the referencedColumnName of a join with an Id of the target entity.


This error is invoked by making use of the @OneToMany Set (which is complemented by a ManyToOne relationship in the problematic entity).




Here is the full stack trace (entities.cm.ContentManagedPage_Item_Link is the problematic one with the ManyToOne.
entities.cm.ContentManagedPage_Item has the field itemname and the OneToMany):

Exception [TOPLINK-6094] (Oracle TopLink Essentials - 2.0 (Build b46-beta3 (05/09/2007))): oracle.toplink.essentials.exceptions.QueryException
Exception Description: The parameter name [itemname] in the query's selection criteria does not match any parameter name defined in the query.
Query: ReadAllQuery(entities.cm.ContentManagedPage_Item_Link)
oracle.toplink.essentials.exceptions.QueryException.parameterNameMismatch(QueryException.java:983)
oracle.toplink.essentials.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:231)
oracle.toplink.essentials.internal.databaseaccess.DatabaseCall.translate(DatabaseCall.java:837)
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:215)
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:286)
oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:616)
oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2417)
oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2395)
oracle.toplink.essentials.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:339)
oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:725)
oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:629)
oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:693)
oracle.toplink.essentials.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:1831)
oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:953)
oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:102)
oracle.toplink.essentials.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:92)
oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:106)
oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:176)
oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:248)
oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:106)
oracle.toplink.essentials.indirection.IndirectSet.buildDelegate(IndirectSet.java:194)
oracle.toplink.essentials.indirection.IndirectSet.getDelegate(IndirectSet.java:309)
oracle.toplink.essentials.indirection.IndirectSet$1.<init>(IndirectSet.java:360)
oracle.toplink.essentials.indirection.IndirectSet.iterator(IndirectSet.java:359)
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sean,

I am not aware of any problems with using composite ids in TopLink Essentials. What do your mappings look like?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic