title: could not insert select SCOPE_IDENTITY() fluent nhibernate one to many
body: <p>I have an error exception: "could not insert select SCOPE_IDENTITY()". After certain hours of googling, I found that I have a mistake in my Mapping files. I tried all the possible solutions, but the error keeps appearing.
  <br/>My mapping files:</p>
  
  <pre><code>public sealed class EmployeeMap : ClassMap&lt;Employee&gt;
  {
      public EmployeeMap()
      {
          Table("dbo.Employee");
  
          Id(x =&gt; x.Id).Column("EmployeeId");
          Map(x =&gt; x.Name);
          Map(x =&gt; x.Job);
          HasMany(x =&gt; x.Phones).KeyColumn("EmployeeId").Table("dbo.Phone")
              .Inverse()
              .Cascade.All();
      }
  }
  public sealed class PhoneMap : ClassMap&lt;Phone&gt;
  {
      public PhoneMap()
      {
          Table("dbo.Phone");
          Id(x =&gt; x.Id).Column("PhoneId");
          Map(x =&gt; x.PhoneNumber);
          Map(x =&gt; x.PhoneType);
          Map(x =&gt; x.EmployeeId);
          References(x =&gt; x.Employee).Column("EmployeeId").Not.Nullable();
      }
  }
  </code></pre>
  
  <p>The problem occurs in Session.SaveOrUpdate().<br/>
  Where did I wrong? </p>