-->
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.  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Fri Dec 30, 2005 7:53 am 
Newbie

Joined: Thu Dec 15, 2005 6:02 am
Posts: 8
Hi all,

Just a little word to say this book is a very interesting and I give thanks to the author for it.

I've a little question concerning the code exemple in the 6.3.2 section. How should I do if I want to have a separate primary key in the CATEGORY_ITEM table.

SQL Schema :
Code:
CATEGORY_ITEM
CAT_ITEM_ID
CATEGORY_ID
ITEM_ID


Thanks in advance for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 30, 2005 7:57 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Map it as an entity class with two many-to-one associations. Map the one-to-many collections of Category and Item if you absolutely want to, or use a query when you need this data.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 30, 2005 8:16 am 
Newbie

Joined: Thu Dec 15, 2005 6:02 am
Posts: 8
In fact, I don't need to know the CAT_ITEM_ID value (that's a serial). But if I don't change any line of the exemple.
Should I be sure this works well.

I have to to work with existing tables and all link tables have this schema.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page Previous  1, 2

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.