*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Owning side of the relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Owning side of the relationship" Watch "Owning side of the relationship" New topic
Author

Owning side of the relationship

Karnati Sudhakar
Ranch Hand

Joined: Aug 26, 2008
Posts: 270

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


Regards
Sudhakar
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Fu Dong Jia
Ranch Hand

Joined: May 23, 2007
Posts: 131
Thanks Christophe!


who dare win!<br />SCJP5(94%)|SCWCD5(86%)|SCBCD(100%)|SCEA in progress
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Owning side of the relationship