-->
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: Hibernate Arrays with composite IDs.
PostPosted: Sat Jan 22, 2005 6:03 am 
Newbie

Joined: Mon Nov 29, 2004 8:15 pm
Posts: 6
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
2.1.7


Mapping documents:
<hibernate-mapping>
<!-- com.kbstar.bcs.commonutil.TestArray root -->
<class name="TestArray" table="TestArray">
<composite-id>
<key-property name="id" column="id" type="string"/>
<key-property name="currencyId" column="currency" type="string"/>
</composite-id>
<property name="amount" column="amount" type="double"/>
<array name="myarr" table="myarr">
<key>
<column name="uid_1"/>
<column name="uid_2"/>
</key>
<index column="idx"/>
<composite-element class="ArrClass">
<property name="lower" column="lower" type="long"/>
<property name="upper" column="upper" type="long"/>
</composite-element>
</array>
</class>
</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:Oracle 9i

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I have a class with a composite id and an array of object in that class which has been specified as an array in the hbm file. The problem is that when I do a session.load of the main class(TestArray) the array(MyArr) is not populated in TestArray. I can see the query being fired on the array table(myarr) however the array itself is not populated. If I change the composite-id to a single id then the array is correctly populated.
Am I doing something wrong or is this not supported in Hibernate?

Please help.

Thanks.


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.