title: Cannot delete detached child from collection in parent in Hibernate
body: <p>I have the following entities with a parent-child relationship:</p>
  
  <pre><code>public class Parent {
    @Id @GeneratedValue String id;
  
    @Version Long version;
  
    @OneToMany(mappedBy = "parent", orphanRemoval = true)
    @Cascade({CascadeType.ALL})
    Set&lt;Child&gt; children;
  
    // getters and setters
  }
  
  public class Child {
    @Id @GeneratedValue String id;
  
    @ManyToOne
    @JoinColumn("parent_id")
    Parent parent;
  
    // getters and setters
  }
  </code></pre>
  
  <ol>
  <li>I retrieve a Parent for edit on the web UI by copy properties to a ParentDto, which has a list of ChildDtos. </li>
  <li>Once I'm done editing, I send the ParentDto object back and copy all properties into a new Parent object (parent) with a new HashSet to store the Children created from the list of ChildDtos. </li>
  <li>Then I call getCurrentSession().update(parent);</li>
  </ol>
  
  <h3>The problem</h3>
  
  <p>I can add children, update children, but I can't delete children. What is the issue here and how do I resolve it?</p>
  
  <p>Thanks in advance.</p>