-->
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: any relation with a class that uses a composite id
PostPosted: Mon Mar 08, 2004 2:40 pm 
Newbie

Joined: Mon Mar 08, 2004 2:05 pm
Posts: 4
I'm using hibernate 2.1.2 and I want to use the <any> relationship in order to achieve the "table-per-concrete-class" inheritance mapping strategy (as described in chapter 16 of the pdf).
I got one example working which uses a class that has one id field of type string.

The next thing I need is to get it working when the conrete class uses a composite id. I tried adding an extra column entry to the <any> section (as suggested in section 5.2.5) but that resulted in an error. Also if I do this I do not know what to specify as id-type.



Currently I have something like this which is NOT working

<class name="Parent">
.....

<any name="child" meta-type="class" id-type="java.lang.String">
<column name="childClass"/>
<column name="childId1"/>
<column name="childId2"/>
</any>

</class>

<class name="concretChild1" >
<composite-id>
<key-property name="key1" column="XZY"/>
<key-property name="key2" column="ZER"/>
</composite-id>
.....
</class>

in the database/hibernate class key1 is a string and key2 is an int

thanks for your pointers


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.