Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Bidirectional - Only one @JoinColumn

Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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

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" ?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic