• 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

Hibernate Bi-directional associations: Many-Many mapping, inverse-true

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I am a newbie to Hibernate, reading the "Hiberbate Quickly" by Patrick Peak, Nick Heudecker. In chapter 5 Collection and Custom Types, Bidirectional relations page 145, the author says "Changes made to the inverse end of association will not be persisted".

Can some please help in better understanding the above statement?
[ November 13, 2006: Message edited by: Santosh Ramachandrula ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well inverse just makes the bi-directional part happen so Hibernate knows that the two sides map the same relationship. It comes down to the cascade option to determine how relationships are persisted or not.

Mark
 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark thanks for your response. So far what I have understood through some discussion is that::
In a many to many bi-directional mapping we would want to keep one of the mapping as inverse="true" so that only one table inserts the rows into JOIN TABLE thus avoiding attempting duplicate insertions in the JOIN TBALE and hence "Changes made to the inverse end of association will not be persisted"

Hope my explanation was clear enough
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic