title: Fluent nhibernate One-to-Many when Inverse is used Child table's Foreign key is null
body: <p>I have a parent and child table and entites are created and mapped using one to many relation ship. On one to many side when i use Inverse() then the child table's foreign key value is inserted as null. </p>
  
  <pre><code>public class TableA
  {
     public virtual long ID { get; set; }
     public virtual string Name { get; set; }
     public virtual IList&lt;TableB&gt; TableB { get; set; }
  }
  
  public class TableB
  {
     public virtual long ID { get; set; }
     public virtual string Name { get; set; }
     public virtual TableA TableA { get; set; }
  }
  
  public class TableAMap : ClassMap&lt;TableA&gt;
  {
     public TableAMap()
     {
        Id(x=&gt;x.ID);
        Map(x=&gt;x.Name).Column("Name");
        HasMany(x=&gt;x.TableB)
            .KeyColumn("TableA_ID")
            .Inverse()
            .Cascase.All()
            .Not.LazyLoad();
     }
  }
  
  public class TableBMap : ClassMap&lt;TableB&gt;
  {
     public TableBMap()
     {
        Id(x=&gt;x.ID);
        Map(x=&gt;x.Name).Column("Name");
        References(x=&gt;x.TableA).Column("TableA_ID").Not.LazyLoad();
     }
  }
  </code></pre>
  
  <p><strong>Note</strong> When the <code>Inverse()</code> is removed from many to one the new records are inserted without any issues and the foreign key is inserted without any issues but when i update a record the foreign key of the existing records are replaced as null. </p>
  
  <p>Please help me i looked in to similar questions but it doesn't help me. </p>
  
  <p><a href="https://stackoverflow.com/questions/11213274/fluent-nhibernate-one-to-many-relationship-setting-foreign-key-to-null">Fluent NHibernate one-to-many relationship setting foreign key to null</a></p>