My customer object has a property Id which corresponds with the primary key in the database table.
I defined the hbm.xml like this:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="MyApp.Core.Domain.Customer, MyApp.Core" table="customer">
<id name="Id" type="Int64" column="customerid" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="Description" column="description"
</class>
</hibernate-mapping>
When I create a new instance of the customer object, Id remains 0 and not -1 like I defined. Am I doing something wrong?
Greets,
Jack