hibernate insert to a collection causes a delete then all the items in the collection to be inserted
- by Mark
I have a many to may relationship CohortGroup and Employee. Any time I insert an Employee into the CohortGroup hibernate deletes the group from the resolution table and inserts all the members again, plus the new one. Why not just add the new one?
The annotation in the Group:
@ManyToMany(cascade = { PERSIST, MERGE, REFRESH })…