• Post Reply Bookmark Topic Watch Topic
  • New Topic

many-to-many relationship with annotation  RSS feed

Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • 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 ?


Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!