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: One - to many relation with composite-id
PostPosted: Tue Feb 12, 2008 4:23 am 
Beginner
Beginner

Joined: Mon Jan 21, 2008 8:57 am
Posts: 20
Hi,

I was wondering how you do a one-to-many relation when you use a composite-id?

Cheers
Philz


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 3:03 am 
Beginner
Beginner

Joined: Mon Jan 21, 2008 8:57 am
Posts: 20
To elaborate a little my xmlFile looks like this:
<composite-id>
<key-property name="PartsId" column="PartsID" />
<key-property name="TestOrderId" column="TestOrderID" />
</composite-id>
<property column="Author" type="String" name="Author" not-null="true" length="50" />
<property column="EditDate" type="DateTime" name="EditDate" />
<property column="EditAuthor" type="String" name="EditAuthor" length="50" />


If I in another file want to make a one-to-many relation to this xml file, how do I do it?

Usually I would do like this, if there would only be one PK:
<set
name="Parts"
inverse="true"
cascade="all-delete-orphan">
<key column="PartId"/>
<one-to-many class="data.Part, data"/>
</set>


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.