title: I want generate INSERT which include my Primary Key (not generated) by NHibernate. How to map Id column for this?
body: <p>I have table <code>CUSTOMER</code> where <code>CUSTOMER_ID</code> is primary key.</p>
  
  <p><strong>Table</strong></p>
  
  <pre><code>CREATE TABLE [CUSTOMER](
      [CUSTOMER_ID] [int] NOT NULL,
      [START_DATE] [varchar(30)] NOT NULL,
  CONSTRAINT [PK_CUSTOMER] PRIMARY KEY CLUSTERED ( [CUSTOMER_ID] ASC .....
  </code></pre>
  
  <p><strong>Mapping</strong></p>
  
  <pre><code>public class CustomerMap : ClassMap&lt;Customer&gt; {
      public CustomerMap()
      {
          WithTable("CUSTOMER");
          Id(x =&gt; x.CustomerID, "CUSTOMER_ID");
          Map(x =&gt; x.Name, "NAME");
      }
  }
  </code></pre>
  
  <p>I need to handle assigning of the CustomerID property manually. For example I created new Customer with CustomerID = 777 and name "stackoverflow".</p>
  
  <p>When I call method Session.SaveOrUpdate(customer);
  I want NHibernate to generate me SQL like this:</p>
  
  <pre><code>INSERT INTO [CUSTOMER] ([CUSTOMER_ID] ,[NAME]) VALUES (777,'stackoverflow')
  </code></pre>
  
  <p>Unfortunately I'm getting errors.</p>
  
  <p>Main issue here is that Nhibernate tries to generate ID for me. But I want to save my entity exactly with 777.</p>
  
  <p>I think there should be way to setup mapping for Id() some another way so this will allow me do what I want.</p>
  
  <p>Please help.</p>