This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate one-to-many association Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate one-to-many association" Watch "Hibernate one-to-many association" New topic
Author

Hibernate one-to-many association

Lars Vonk
Ranch Hand

Joined: Aug 05, 2005
Posts: 30
Hello,

The Hibernate reference Documentation 3.0.5 states in paragraph 8.2.3 that:

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

Does anyone know why this is considered an unusual case (I have seen it many times) and not recommended?
Regards,
Lars
[ August 21, 2005: Message edited by: Lars Vonk ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

A unidirectional one-to-many association can only exist if the "many" is a stand alone entity, and that is fairly unusual (in my experience anyway). Since most one-to-many relationships tend to define parent-child relationships they would normally be bidirectional.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Lars Vonk
Ranch Hand

Joined: Aug 05, 2005
Posts: 30
Thanks for replying Paul. I agree with you that most of the one-to-many association can be described as parent-child, although I cannot say I find the 'stand-alone' version an unasual scenario. Thanks again.
 
Don't get me started about those stupid light bulbs.
 
subject: Hibernate one-to-many association