• 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

why do we need to specity the owner side of the relationship

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Can anybody tell me the idea of ownering in the bidirectional relationships?
Why the Entity Manager needs to know the owner side of the relationship?
your help is appreciated
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maizar,

maybe this could help you: EJB3 Entity Relationship


John
 
maizar samman
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks John,
I read this thread before but actually I didn't find the answer to why knowing the owner side is helpful to the Entity Manager
now, I know how to use @mappedBy in the relationships but dont know why it exists at the first place
 
John Bengler
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I'm not sure if there is a deeper meaning, I see it more as a convenient way of defining a bidirectional relation.

One reason I can imagine is that you somehow have to "link" both sides of a bidirectional relationship, if you use features like CASCADE, but this is just an idea.

 
maizar samman
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yea John I think using it when using cascade makes sense a bit .. only a bit
but I think there must be a deeper meaning for it otherwise they won't make it a mandatory element (isn't it mandatory in the bidirectional relationship?!)
 
John Bengler
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wouldn't we have just two unidirectional relations when we don't use the mappedBy?
reply
    Bookmark Topic Watch Topic
  • New Topic