Just use the NullableTypes. You could be confused - the NullableTypes can't actually be set to null. They provide a "HasValue" property, which does the same thing as your IsBirthDateNull() function.
Here is an implementation of what you want using the NullableTypes:
Code:
Class Person{
private NullableDateTime birthDate;
public DateTime BirthDate{
get{ return this.birthDate.Value;}
set{ this.birthDate = value;}
}
internal NullableDateTime NullableBirthDate
{
get{ return this.birthDate; }
set{ this.birthDate = value; }
}
public bool IsBirthDateNull()
{
return !this.birthDate.HasValue;
}
The mapping for this class would then look like this:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Namespace.Person, Assembly" table="PersonTable">
<id name="Id" type="Int32" unsaved-value="0" column="PersonId">
<generator class="native" />
</id>
<property name="NullableBirthDate" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" column="BirthDateColumn"/>
</class>
</hibernate-mapping>