File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 agree. Here's the link:
subject: Hibernate one-to-many association
It's not a secret anymore!