title: Auto Generated Id Using Fluent NHibernate with Oracle 11g
body: <p>I am having issues inserting records using Fluent NHibernate. The code is trying to get a number from a sequence that is non-existent for the KEY field.</p>
  
  <p>{"could not insert: [Class Name ][SQL: INSERT INTO Schema.TableName (KEY, ID) VALUES (hibernate_sequence.nextval, ?) returning KEY into :nhIdOutParam]"}</p>
  
  <p>Of course the hibernate_sequence sequence  doesn’t exist in the database. If I do an insert using SQL Developer say:</p>
  
  <p>INSERT INTO Schema.TableName (ID) VALUES (90); this works and my primary key (KEY) is auto-generated.</p>
  
  <p>I know you can use a sequence to auto generate this value using GenerateBY.Sequence() but is there a way to insert the record using the SQL statment about using Fluent Nhibernate?</p>
  
  <p>I have my class mapped to the primary key in my class for ex.</p>
  
  <pre class="lang-c# prettyprint-override"><code>Id(x =&gt; x.Id, "KEY");
  </code></pre>