This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate one-to-many association" Watch "Hibernate one-to-many association" New topic

Hibernate one-to-many association

Lars Vonk
Ranch Hand

Joined: Aug 05, 2005
Posts: 30

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?
[ August 21, 2005: Message edited by: Lars Vonk ]
Paul Sturrock

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.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Hibernate one-to-many association
It's not a secret anymore!