-->
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: Using a composite key in a Set mapping
PostPosted: Mon Jun 19, 2006 10:33 am 
Newbie

Joined: Thu Jun 15, 2006 4:03 pm
Posts: 3
I have a pair of tables that share a composite key which I'd like to link with a one-to-many set association. I'd like to do something like this:

<set name="mySet">
<key column="pk1"/>
<key column="pk2"/>
<one-to-many class="myOtherClass"/>
</set>

Obviously, this isn't correct, as multiple <key> tags are not supported. Is there a syntax which would support using a composite key as the foreign key into my other table? Thanks.


Top
 Profile  
 
 Post subject: Re: Using a composite key in a Set mapping
PostPosted: Mon Jun 19, 2006 6:32 pm 
Regular
Regular

Joined: Wed Feb 22, 2006 11:28 am
Posts: 65
Location: Santiago, Chile
Change:

<set name="mySet">
<key column="pk1"/>
<key column="pk2"/>
<one-to-many class="myOtherClass"/>
</set>

to:

<set name="mySet">
<key>
<column name="pk1"/>
<column name="pk2"/>
</key>
<one-to-many class="myOtherClass"/>
</set>


Regards.
Neketsu shonen


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.