-->
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: Many-to-many connection table with additional columns
PostPosted: Fri May 19, 2006 5:32 am 
Beginner
Beginner

Joined: Tue Nov 22, 2005 5:33 am
Posts: 31
I have two classes, joined together as a many-to-many relation. I want to add a few columns to the connection table, so that the DB schema looks like this:

-------------- ---------------------- ---------------
| TABLE1 |---- | TABLE1_TABLE2 |---| TABLE2 |
| id | | table1_id | | id |
-------------- | table2_id | ----------------
| extracolumn1 |
| extracolumn2 |
---------------------


Is there a simple way to acheive this with hibernate? Of course I want to be able to set the values of the additional columns using hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 5:51 am 
Beginner
Beginner

Joined: Tue Nov 22, 2005 5:33 am
Posts: 31
Didn't work the way I thought, trying to attach an image instead...
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 11:03 am 
Newbie

Joined: Tue Jan 24, 2006 12:04 pm
Posts: 12
use composite-element

my example is working fine (save-update) except that the relationtable is not updated on deleting.

see
http://forum.hibernate.org/viewtopic.php?t=959685


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.