-->
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: Joincolumn vs Jointable
PostPosted: Wed Sep 26, 2007 3:56 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
In the documentation it is recommendet to use a jointable for one to many mappings instead of a join column.

What is the reasoning behind this? Because from a dbDesign POV I'd recommend just the opposit!


Dokumentation referenced:
http://www.hibernate.org/hib_docs/annot ... ml_single/

Quote:
2.2.5.3.2.2. Unidirectional

A unidirectional one to many using a foreign key column in the owned entity is not that common and not really recommended. We strongly advise you to use a join table for this kind of association (as explained in the next section). This kind of association is described through a @JoinColumn
End of Quote

Thanx for clarification.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 12:16 pm 
Beginner
Beginner

Joined: Mon Jul 23, 2007 12:37 pm
Posts: 24
http://forum.hibernate.org/viewtopic.php?t=986558


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 4:17 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
On the one to may side, this is a very strange situation, and it really doesn't sit well from a database perspective. However, this is not true for the opposite situation. With the many-to-one mapping, using a column is fine.

_________________
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.  [ 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.