-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 'unable to resolve property to corresponding index' error
PostPosted: Tue May 20, 2008 6:10 pm 
Newbie

Joined: Tue Sep 13, 2005 6:23 pm
Posts: 9
I have the following code in a DAO

String selectStatement =
"select {campaignFinishedProduct.*}, {finishedProduct.*} " +
"from gpmq.pack_compliance campaignFinishedProduct " +
" join gpmq.products finishedProduct on " +
" campaignFinishedProduct.manf_id_n = finishedProduct.manf_id_n and " +
" campaignFinishedProduct.upc_c = finishedProduct.upc_c and " +
" campaignFinishedProduct.upc_sufx_c = finishedProduct.upc_sufx_c " +
" left outer join gpmq.sap_resc_upc_xref_v b on " +
" campaignFinishedProduct.gcm_id = b.gcm_id and " +
" campaignFinishedProduct.manf_id_n = b.manf_id_n and " +
" campaignFinishedProduct.upc_c = b.upc_c and " +
" campaignFinishedProduct.upc_sufx_c = b.upc_sufx_c " +
"where ( b.gcm_id is null or b.manf_id_n is null or b.upc_c is null or b.upc_sufx_c is null ) ";

try {
mAnswer = HibernateConnector.getDefault().getSession().createSQLQuery( selectStatement )
.addEntity( "campaignFinishedProduct", CampaignFinishedProduct.class )
.addJoin( "finishedProduct", "campaignFinishedProduct.finishedProduct" )
.list();

} catch( HibernateException ex ) {
throw new DatabaseException( "Unable to load unmapped Packing Campaign Components", ex );
}

Trying to get instances of CampaignFinishedProducts, which hold onto FinishedProducts via a key-many-to-one relationship. See HBM file below.


<class name="CampaignFinishedProduct" table="PACK_COMPLIANCE">

<composite-id>
<key-property name="campaignIdentifier" column="GCM_ID" type="integer" />
<key-many-to-one
name="finishedProduct"
class="com.nppc.mes.domain.productdefinition.FinishedProduct">
<column name="MANF_ID_N"/>
<column name="UPC_C"/>
<column name="UPC_SUFX_C"/>
</key-many-to-one>
</composite-id>

<property name="status" column="CM_STATUS" type="campaignStatus" />
</class>

I get the following error: unable to resolve property [name=finishedProduct] to corresponding index.

I have used this construct in other places to do join queries with Raw SQL. Only difference I can see is that the object I am trying to do the join fetch with is part of the composite-id.

Is this not supported in this situation?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.