-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to describe a one-to-many set with composite-key
PostPosted: Sun Nov 21, 2004 12:31 pm 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
Hi, I'm having some trouble descring a relatively simple one-to-many association in the hbm mapping file.

I'm trying to use, following Hibernate in Action's example, the <set> tag.

The <set> tag wants a <key> tag with the key column and a <one-to-many> tag in my case.

But what if the destination table has a composite key column and I need all of it to map the children to the father ?

If I specify multiple <key> tags, of course, the parser will get angry. So I must be missing something. I even tried the <composite-element> thing but it messed Java code generation!

I know that composite keys are ugly, but we're working with legacy stuff here...

Thanks.

Giulio


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 2:54 pm 
Regular
Regular

Joined: Tue Jan 27, 2004 12:22 pm
Posts: 103
Check chapter 7.4 of the Hibernate documentation.

_________________
Dencel
- The sun has never seen a shadow -


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 6:59 pm 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
Nice!

Thanks, Dencel!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.