Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Owning side of the relationship

 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

The owner of the relationship is purely our taste or is there any rule for that?

In EJB 3 in Action for it is given as
For bidirectional one-to-many relationships,ManyToOne is always the owning side of the relationship.


Is it an advice or rule to be followed?

May be i am asking this question because i did not understand the entity relationships fully
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a rule : The many side of one-to-many / many-to-one bidirectional relationships must be the owning side, hence the mappedBy element cannot be specified on the ManyToOne annotation.
 
Fu Dong Jia
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic