Hello,
I'm trying to map a class so it has second property of type int32 to be autogenerated. My class is mapped as follows:
<class name="MyClass, MyDomain">
<id name="Id" access="nosetter.camelcase-underscore" column="Id" type="Guid" unsaved-value="{00000000-0000-0000-0000-000000000000}">
<generator class="guid.comb" />
</id>
<version name="Version" access="nosetter.camelcase-underscore" type="Int64" unsaved-value="0" />
<property name="SystemNumber" access="nosetter.camelcase-underscore" type="Int32" not-null="true" unique="true" update="false" insert="false" />
....
other properties
....
</class>
I would like to have the SystemNumber autogenerated aswell, basicly, what I need is the MSSQL column property Identity set to 'true'. I can do this manually and it works fine, but I'm wondering if it's doable with mapping.
A composite key solution is not needed. I tried adding generator to the property, but naturally it was ignored.
I wont use SystemNumber as identifier anywhere with Hibernate, it's more of a human readable identity.
Any help is greatly appreciated.
Tomislav
|