• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
[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" ?
 
Honk if you love justice! And honk twice for tiny ads!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic