title: SqlException: Cannot insert the value NULL into column 'x'; column does not allow nulls. INSERT fails
body: <p>I got this message when I execute my "little" program using NHibernate</p>
  
  <pre><code>SqlException: Cannot insert the value NULL into column 'EmployeeId', table 'NHibernateDemoDB.dbo.Employee'; column does not allow nulls. INSERT fails.
  </code></pre>
  
  <p>My method is:</p>
  
  <pre><code>    private void SetEmployeeInfo(Employee employeeData)
      {
          employeeData.FirstName = txtFirstName.Text;
          employeeData.LastName = txtLastName.Text;
      }
  </code></pre>
  
  <p>and my mapping file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true" namespace="NHibernateWinFormsApp" assembly="NHibernateWinFormsApp"&gt;
  
  &lt;class name="NHibernateWinFormsApp.Employee, NHibernateWinFormsApp" lazy="true"&gt;
  
      &lt;id name="EmployeeId"&gt;
  
        &lt;generator class="native"/&gt;
  
      &lt;/id&gt;
  
      &lt;property name="FirstName" column="FirstName"/&gt;
  
      &lt;property name="LastName" column="LastName"/&gt;
  
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Does someone have an idea, please?
  Thank you,</p>