wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes One-To-One Bidirectional - Owning Side & mappedBy property? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "One-To-One Bidirectional - Owning Side & mappedBy property?" Watch "One-To-One Bidirectional - Owning Side & mappedBy property?" New topic
Author

One-To-One Bidirectional - Owning Side & mappedBy property?

Sandeep Vaid
Ranch Hand

Joined: Feb 27, 2006
Posts: 390
[P-276] of EJB3 In Action Book states:
"In a bidirectional relationship, the owning side is the entity that stores the relationship in its underlying table."

I guess by relationship it means the Foreign Key. If this is the case, then in @PrimaryKeyJoinColumn, BillingInfo will
be the owning entity and hence the mappedBy should be defined for User.billingInfo field?

[P-277] of EJB3 In Action Book:
What about bidirectional OneToOne using @PrimaryKeyJoinColumn? Does it uses mappedBy property of @OneToOne annotation?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: One-To-One Bidirectional - Owning Side & mappedBy property?
 
Similar Threads
Naive question on "MappedBy" attribute of @OneToMany
One-To-One Bidirectional - @PrimaryKeyJoinColumn
OneToOne Bidirectional Using @PrimaryKerJoinColumn
@mappedBy
@ManayToMany