title: Can you dynamically fill in a db value on commit in nhibernate/fluent nhibernate?
body: <p>I am using jquery full calendar and one of the things it has is an id that should be unique per appointment or the same per a bunch of appointments.</p>
  
  <p>If you have the bunch of the same id's then all those appointments are considered repeating appointments.</p>
  
  <p>I want to generate a repeating id for each of my appointment and apply it to all the appointments that should have that repeating id.</p>
  
  <p>I figured that the best way to do this would be to use the primary key of my appointment table.</p>
  
  <p>Example</p>
  
  <pre><code>PK: 1, Title: Test1,  Repeating Id: 1
  PK: 2, Title: Test2,  Repeating Id: 2
  PK: 3, Title: Test2,  Repeating Id: 2
  PK: 4, Title: Test2,  Repeating Id: 2
  PK: 5, Title: Test3,  Repeating Id: 5
  </code></pre>
  
  <p>So the first and last row don't have any other rows that repeat with it.</p>
  
  <p>Rows 2 to 4 do repeat with each other.</p>
  
  <p>Now in my code I generate all the repeating rows before insert. Since nhibernate does batch inserts I do all my inserts at once. So at this time I do not know what the PK will be for any of the rows.</p>
  
  <p>I am wondering can I somehow tell it to take the first item that should be inserted and find it's PK out and apply it to all the following items repeatingId column?</p>
  
  <p>Right now I can only think of one way to do that and that is insert the first item and then get the PK back and then batch insert all the other items after with the repeating id filled in.</p>