-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to includes field of mapping table for many-to-many
PostPosted: Tue Jul 01, 2008 5:40 pm 
Newbie

Joined: Thu Nov 16, 2006 11:52 am
Posts: 8
Location: Frankfurt a.M., Germany
Hello,

we have a many-to-many realtionship where the mapping table besides the respective foreign keys contain additional fields that need to be filled when a new entry is inserted into the mapping table.

The question is now how the values for these additional fields can be inserted. In the category-item example in the hibernate docs the mapping table CATEGORY_ITEM is only specified in the hbm.xml. There is no Java-side class defined that would represent the mapping table as this is usually not needed.

Does anybody have an idea how to make sure that these additional fields in the mapping table can be filled using the same transaction that was used to insert the other entries for the many-to-many relationship?

Thanks, Oliver Holp


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 01, 2008 6:08 pm 
Beginner
Beginner

Joined: Wed Oct 19, 2005 3:30 pm
Posts: 25
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 02, 2008 6:05 am 
Newbie

Joined: Thu Nov 16, 2006 11:52 am
Posts: 8
Location: Frankfurt a.M., Germany
Thanks for the eloquent answer :-)). I bought the hibernate bible now and it even explains in a section of its own how to do this.

Cheers, Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 11:09 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Maybe you could post a quick synopsis of what you found?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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