I've got still 2 issues:
1. The datetime field in the database is filled with '1-1-1900 0:00:01' when I leave the NullableDateTime property empty.. Is there a way to make sure that this field stays empty when I don't fill in a date? If not, it's not a big problem, but I was just wondering. I'm using MSSQL.
2. When NHibernate tries to read the objects with the NullableDateTime property, I'll get an exception. The ADOException is: 'Could not cast the value in field date2_ of type DateTime to the Type SerializableType. Please check to make sure that the mapping is correct and that your DataProvider supports this Data Type.'
My mapping file looks 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="Int32" column="customerid" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="Date" column="date" type="Nullables.NullableDateTime, Nullables"/>
</class>
</hibernate-mapping>
Is there something wrong with my mapping of the date property?