title: NHibernate doesn't remove unuseful record when update child collections
body: <p>When I use Nhibernate 3 to update children, the removed item in children doesn't delete from databse.</p>
  
  <p>Case describe below</p>
  
  <pre><code>class Parent {
     string Id;
     string Name;
     IList Children;
  }
  class Child {
     int ChildId;
     string Name;
     string Value;
     Parent parent;
  }
  </code></pre>
  
  <p>hdm Mapping file shows below 
  Parent.hdm.xml</p>
  
  <pre><code>&lt;bag name="Children" table="ClientsExt" inverse ="true" cascade="all-delete-orphan" lazy="false"&gt;
    &lt;key column="ChildId"/&gt;
    &lt;one-to-many class="XXXX.Child, XXX"/&gt;
  &lt;/bag&gt;
  </code></pre>
  
  <p>Child.hdm.xml</p>
  
  <pre><code>&lt;many-to-one name="Parent" column="Id" class="XXXX.Parent, XXX" not-null="true"/&gt;   
  </code></pre>
  
  <p>Let's suppose there is existing parent which associates a set of children  in database</p>
  
  <pre><code>Parent Table
  Id = "P1", Name = "Test"
  Child Table
  ChildId = 1, Id="P1", Name = "N1", Value = "V1"
  ChildId = 2, Id="P1",Name = "N1", Value = "V2"
  ChildId = 3, Id="P1",Name = "N2", Value = "V3"
  </code></pre>
  
  <p>In my case, I need to update children partially. 
  In the updated Parent need to update the record 2
  set value of ChildId = 2, to value = "NEWVALUE"
  and <strong>remove</strong> ChildId = 1, Id="P1", Name = "N1", Value = "V1"
  and ChildId 3 will be keep.</p>
  
  <p>so I get the Parent from database firstly, </p>
  
  <pre><code>var entity = _parentRepo.getById("P1");
  
  var children = entity.Children;
  
  var updatedChildren = children.ToList&lt;Child&gt;;
  
  var tmpList = new List&lt;Child&gt;();
  
  //biz means the business logic object which contains update info
  
  if (biz.N1.Count &gt; 0){
  
       var existN1 = children.Where(x=&gt;x.Name.Equals("N1")).Select(y=&gt;y.ChildId);
  
       int count = existN1.Count;
  
       int index = 0;
  
       biz.N1.ForEach(x=&gt;{
  
           if(index &lt; count){
              tmpList.Add(new Child(){ Id = existN1[index],Name="N1",Value="newValue",Parent = entity });
           }else{
             tmpList.Add(new Child(){ Name="N1",Value="newValue",Parent = entity });
           }
       });
  
    updatedChildren.RemoveAll(x=&gt;x.Name.Equals("N1"));
  
    updateChildren.AddRange(tmpList);
  }
  
  entity.Children = updateChildren;
  //Save the entity
  </code></pre>
  
  <p>However, in Database, the record 2 update the value to "NEWVALUE", but didn't remove the ChildId = 1, Id="P1", Name = "N1", Value = "V1" . 
  Why?</p>
  
  <p>thanks in advance.</p>