• 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Frits Walraven
  • Himai Minh

many-to-many relationship with annotation

Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In hibernate, I have an object like below, People has many-to-many relationship with Project, I want to achieve these functions:

1. when saving a new People, don't save ProjectList and its relationship.
2. when updating a People, don't update ProjectList and its relationship.
3. when deleting a People, delete People and its relationship, but keep Project object
4. when searching with HQL, like normal class, its inner join should be working.

In conclusion, the key part is in saving-new and updating. how to achieve this using annotation ?


Your mind is under my control .... your will is now mine .... read this tiny ad
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic