-->
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: one-t-many clarification
PostPosted: Tue Oct 10, 2006 7:28 pm 
Beginner
Beginner

Joined: Tue Aug 08, 2006 11:53 am
Posts: 37
Hi all,

In the hibernate 3 ref manual, i came across the following statement

"A unidirectional one-to-many association on a foreign key is a very unusual case, and is not really recommended."

The manula also says

"A unidirectional one-to-many association on a join table is much preferred. Notice that by specifying
unique="true", we have changed the multiplicity from many-to-many to one-to-many."


Can someone pls help me understand why it is not recommended!

Thank you in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 10, 2006 8:27 pm 
Beginner
Beginner

Joined: Tue Sep 26, 2006 11:46 pm
Posts: 33
With the current implementation of Hibernate, uni-directional one-to-many relationships without a join table result in hibernate executing an insert and an update for the child table.

Insert to set all the properties of the child table
then Update to set the foreign key back to the parent.

This has a really bad performance impact.


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.