-->
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.  [ 2 posts ] 
Author Message
 Post subject: Composite-id key properties not recognized in createSQLQuery
PostPosted: Fri Dec 03, 2004 4:59 pm 
Newbie

Joined: Fri Dec 03, 2004 4:41 pm
Posts: 15
I'm using a create SQL query that maps to a class with composite primary keys mapping to a oracle 9i database. I need it to call a max function on a particular column that's one of the composite ids.

I keep getting the error net.sf.hibernate.QueryException: No column name found for property [partyId] though my find functions work great and it doesn't give a error on the regular property elements. Is there a way to map to composite ids using this call?

ex:
createSQLQuery("select {pad}.test as {pad.test}, max({pad}.prty_id) as {pad.partyId} " +
"from MYTABLE {pad}",
"pad", MyClass.class)

mapping ex:

<class name="MyClass" table="MYTABLE">

<composite-id name="pk" class="MyPrimaryKey">
<key-property name="partyId" column="PRTY_ID" type="java.math.BigDecimal" />
</composite-id>
<property name="test" column="modified_by" />
</class>


Top
 Profile  
 
 Post subject: Version 2.7c
PostPosted: Fri Dec 03, 2004 5:11 pm 
Newbie

Joined: Fri Dec 03, 2004 4:41 pm
Posts: 15
Sorry, forgot the version, 2.7c


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

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.