In hibernate, cascading operations are used. That is, there is a collection one end operation, the associated table to be automatically manipulated.
At this time there are collection to configure <set cascade= "?" >
Optional value for the Cascade property:
All: Associated operations are performed in all cases.
None: No associated action is performed in all cases. This is the default value.
Save-update: Associate action when performing save/update/saveorupdate.
Delete: Associating action when delete is executed
All-delete-orphan: All cases, including set.remove ()
If you use set for Remove, it is best to configure All-delete-orphan so that you can delete objects in a cascading table.
In addition Set.remove () will complain, java.util.ConcurrentModificationException
Attempting to use Collections.sychronizedset () also makes an error, which may not be appropriate for this method.
Solution: Measured several times did not appear the problem.
is to save the object to be deleted to the new Tempset,
Then Set.removeall (tempset);