title: Fluent nhibernate map list of items
body: <p>I have a class "Company" which has a list of "Operator"</p>
  
  <pre><code>public class Company
  {
     public IList&lt;Opertator&gt; Operators {get; set; }
     public Int32 Id {get; set;}
  }
  
  public class Operator {
     public Int32 Id {get; set; }
    public Company Company {get; set; }
  }
  </code></pre>
  
  <p>When I mapped as follows:</p>
  
  <pre><code>public class CompanyMapping : ClassMap&lt;Company&gt;
      {
          public ProductMapping() : base()
          {
              Id(x =&gt; x.Id, "CompanyId").GeneratedBy.Native();
              HasMany(x =&gt; x.Operators);
           }
      }
  
  public class OperatorMapping : ClassMap&lt;Operator&gt;
  {
      public OperatorMapping() 
      {
            Id(x =&gt; x.Id);
            Reference(x =&gt; x.Company);
      }
  }
  </code></pre>
  
  <p>I have a UI where user can add operators and remove operators by checking boxes.
  in c# code, I query the stored company, and add to the list, or remove from the list.
  then send SaveOrUpdate.
  My problem is when I add one more operator to existing company, and save/Update, the NHibernate is deleting the whole list, and reinster them again.</p>
  
  <p>I don't want to do that.
  Can I have it, that NHibernate will detect the changed items (new items from the list, and insert them, and determine the deleted item and delete them)?</p>
  
  <p>I tried change the mapping to have in the company mapping </p>
  
  <pre><code>HasMany(x =&gt; x.Operators).Inverse();
  </code></pre>
  
  <p>but it end up not deleting at all.
  Any help?</p>