I'm using NHibernate to map my objects to the DB. One of these object is called "Attachment". its ID is generated using the "newsequentialid" in MS SQL server 2008 (as the Default Value or Binding) to create the Guid for the id column.
Now what i want is that when a new Attachment is inserted then NHibernate will allow the SQL Server to create the Guid using the newsequentialid. Thing is that the i keep getting an exception "null identifier" when trying to save a new Attachment where the id is not set (Guid.Empty)
here is my HBM file:
<class name="DataObjects.Services.NHAttachment, DataObjects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" mutable="false" table="Attachments">
<id name="Id" column="Guid" type="Guid" >
<generator class="native" />
</id>.....
As you can see the ID is set with a generator class as native.
Thanks for all the help in advance!! :)