title: nhibernate not saving foreign key Id
body: <p>I have a simple model I'm attempting to persist using fluent-nhibernate:</p>
  
  <pre><code>public class Person
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public IList&lt;Address&gt; Addresses { get; set; }
  }
  
  public class Address
  {
      public int Id { get; set; }
      public int PersonId { get; set; }
      public string Street { get; set; }        
  }
  </code></pre>
  
  <p>Some sample data:</p>
  
  <pre><code>var person = new Person() {Name = "Name1", Addresses = new[]
      {
          new Address { Street = "Street1"},
          new Address { Street = "Street2"}
      }};
  </code></pre>
  
  <p>When I call <code>session.SaveOrUpdate(person)</code> both objects are persisted but the foreign key is not saved in the Address table:</p>
  
  <p><img src="https://i.stack.imgur.com/wAWmJ.jpg" alt="enter image description here"></p>
  
  <p>What am I doing wrong? My mappings overrides are as follows:</p>
  
  <pre><code>public class PersonOverrides : IAutoMappingOverride&lt;Person&gt;
  {
      public void Override(AutoMapping&lt;Person&gt; mapping)
      {
          mapping.Id(x =&gt; x.Id);
          mapping.HasMany(x =&gt; x.Addresses).KeyColumn("PersonId").Cascade.All();            
      }
  }
  
  public class AddressOverrides : IAutoMappingOverride&lt;Address&gt;
  {
      public void Override(AutoMapping&lt;Address&gt; mapping)
      {
          mapping.Id(x =&gt; x.Id);               
      }
  }
  </code></pre>
  
  <p><strong>Please note</strong>, I plan on using <code>List&lt;Address&gt;</code> in other entities and I don't want to add an <code>Address.Person</code> property.</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>I've got this to 'work' by replacing <code>Address.PersonId</code> with <code>Address.Person</code> but I don't want the <code>Address</code> to have a Person property, as I don't want that circular reference. Also, when inserting the above object looking at the logs nHibernate appears to 
  1) insert Person
  2) insert Address with NULL PersonId
  3) update Address with PersonId (when flushing)
  when really steps 2 &amp; 3 can be done at the same time? This causes another issue if NULL is disallowed on Address.PersonId</p>
  
  <p><strong>UPDATE 2</strong>
  Removing the property <code>Address.PersonId</code> results in <code>PersonId</code> becoming populated in the database. nHibernate doesnt like me providing my own PersonId that its clearly using internally for inserting/retrieving records. So really I want to flag my <code>Address.PersonId</code> with a 'hey this isnt a standalone field its the field you're going to use down the track please done treat it specially' flag.  Also, as above, nHibernate appears to insert NULL into the PersonId column (when <code>Save</code>ing) and THEN update it afterwards (when <code>Flush</code>ing) ??</p>