Joined: Wed May 09, 2007 5:39 am Posts: 2 Location: Glasgow, Scotland
|
I think I've stumbled across a bit of problem with the way NHibernate determines when things are dirty.
I have the following mapping file:
<class name="ServiceScheduleSubComponent, Application.BusinessObject" table="ServiceScheduleSubComponents">
<id name="Id" column="Id" access="nosetter.camelcase-underscore" unsaved-value="00000000-0000-0000-0000-000000000000">
<generator class="guid"/>
</id>
<discriminator column="Type"/>
<property name="NotApplicable" column="NotApplicable" access="nosetter.camelcase-underscore"/>
<property name="RequiringVerification" column="RequiringVerification" access="nosetter.camelcase-underscore"/>
<property name="Comments" column="Comments" access="nosetter.camelcase-underscore"/>
<property name="Disabled" column="Disabled" access="nosetter.camelcase-underscore"/>
<subclass name="IntegerServiceScheduleSubComponent, Application.BusinessObject" discriminator-value="Integer">
<property name="FailCount" column="FailCount" access="nosetter.camelcase-underscore"/>
</subclass>
<subclass name="BooleanServiceScheduleSubComponent, Application.BusinessObject" discriminator-value="Boolean">
<property name="Failed" column="Failed" access="nosetter.camelcase-underscore"/>
</subclass>
</class>
Now the trouble is that in both my subclasses the fields that are specific to them are Boolean and Int32 values. Unfortunately though, in my database I need to allow both fields to be nullable. That appears to mean that when NHibernate is trying to figure out if the values are dirty it always answers yes.
Any ideas as to how get round this?
|
|