title: Hibernate. Remove on update child list
body: <p>I have standard <code>@ManyToOne</code> association in Hibernate. When updating, I'm creating new entity (using <code>new</code> keyword) and fill it with necessary values (ID also inserted). Values comes from UI. In same way I create new collection of child objects, fill each of them by values (ID also inserted), and store collection in parent object (using setter or by <code>addAll()</code> method). </p>
  
  <p>So my question is: how I can remove all objects in parent collection when updating parent, and replace them by new collection. In new collection some objects are really new and some only need to be updated (they have inserted ID).</p>
  
  <p>I learned about <code>orhanRemoval</code>, but it can't help, because parent object must be in "managed" state (so <code>clear()</code> on child collection will not work), not in transient state as in my example..</p>