Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Bidirectional - Only one @JoinColumn Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Bidirectional - Only one @JoinColumn" Watch "Bidirectional - Only one @JoinColumn" New topic
Author

Bidirectional - Only one @JoinColumn

Sandeep Vaid
Ranch Hand

Joined: Feb 27, 2006
Posts: 390
[P-276]:
"Note that you do not have to define @JoinColumn in the entities of both sides of one-to-one relationships."
Does this mean that we "Do Not Have To" OR "We Can't" define @JoinColumn in the entities of both sides of one-to-one
relationships?

Moreover [P-279p Of EJB3 In Action Book States:
"Note that the exact @JoinColumn specification could have been repeated for both the Bid.item and Item.bids
persistent fields on either side of the relationship."

The contradiction of this statement is @ [P-280]
"The persistence provider will generate deployment-time errors if you specify @JoinColumn on both sides of a
bidirectional one-to-many relationship."

Does this mean repetation of @JoinColumn is allowed in "OneToMany - ManyToOne" case but not allowed in bidirectional
"OneToOne" ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bidirectional - Only one @JoinColumn
 
Similar Threads
Problem with One-To-Many bi-directional mapping
Hibernate association mapping
How to create a tables having One to One relation ship to each other
The word inverse in a Bidirectional Relationships
Exception while firing the join queries