If 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 difference is in saving-new and updating. how to achieve this ?
Thanks.
Code:
class People{
String name;
List<Project> projectList;
}