-->
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: prim key on multiple columns
PostPosted: Thu Oct 28, 2004 8:56 am 
Newbie

Joined: Thu Oct 28, 2004 7:44 am
Posts: 2
Hello, we're using hibernate for some time now. But we have a problem now which we can't solve. Let's say we have a database model with a table timetable and a table member. To couple these two we create a table TimetableMember. The primary key of the table TimetableMember will be the timetableid and the memberid combined so . Now we want to create this situation in hibernate but we can't get this to work. The ProductMember class has many to one relation with member and product. Now we want hibernate to generate a table where product and member together are the primary key of the table. The docs tells us to use a composite-id but we can't get this to work. Can somebody please help us by pointing us in the right direction how to achive this in hibernate and better in xdoclet?

Here is a sketch of the situation:

Conceptual model:
Image
Physical model:
Image

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 29, 2004 5:11 am 
Newbie

Joined: Thu Oct 28, 2004 7:44 am
Posts: 2
Maybe another solution?


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.