Hi
I have a class called Case. The case has to have a unique Case number for reference, but this is not a primary key. I have an int identity field in my SqlServer 2005 db table. In my mapping file for the class I have disabled the insert and update for the class so the database kan control the value:
Code:
<class name="xxx.Case, xxx" table="Cases">
<id name="Id" type="Guid">
<column name="Id" sql-type="uniqueidentifier" not-null="true" unique="true" index="PK_Cases"/>
<generator class="assigned" />
</id>
<property name="CaseNumber" type="Int32" update="false" insert="false">
<column name="CaseNumber" sql-type="int" not-null="false"/>
</property>
My problem is that I can see through the profiler that the correct sql is returned (fx CaseNumber 32), but when it gets through the session, it is always 1.
Has anyone seen this behavior before, or is there another way to have the database issue the value?
Thanx
Code: