• 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

Uni-direction ManyTomany mapping with annotations

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i have a Basket class mapping ProductItem class with ManyToMany relationship. I only did the mapping on Basket

I would like to know if ProductItem will be updated if i execute hibernate update on Basket ... Say i have on ProductItem productA, productB, productC which are contained on the Basket (hence the relationship). If i remove productA (i do this by creating a new basket with only productB and productC then persist the new basket using update), would ProductItem table be updated? if not, how should i achieve this...
 
Ranch Hand
Posts: 106
Hibernate Python MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would rather ask why a unidirectional many-to-many relationship would make sense. This is contradictory by nature IMHO. In a many-to-many relationship there's no real owner, so the target side should be able to access the other as well.

Karsten
 
crispy bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic