Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-many association

 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lars Vonk
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic