In my application, a hibernate operation goes like this. The application updates a parent entity with new values from the request and deletes all the existing (previously insert
instead of setChilds use addAll ,
setChilds
addAll
from this,
parent.getChilds().clear(); parent.setChilds(newChilds);
to
parent.getChilds().clear(); parent.getChilds().addAll(newChilds);