I\'m doing a fairly complex NHibernate transaction in a financial system, creating a payment, recording the ledger entries, checking to see if the payment is the total amoun
I encountered the same error. This is my sample mappings:
ManyToOne(x => x.objPerson, map => { map.Column("PersonID"); map.NotNullable(false); });
Property(x => x.intPersonID, map => map.Column("PersonID"));
If I tried to persist/save this on my database by populating only the property intPersonID
and making the objPerson
null, this will trigger the dehydrating error on all your properties!
The reason I am just populating intPersonID
is to prevent querying on the database to get the objPerson
before saving to the database. Unfortunately, it will trigger an error, so I modified my mappings and corrected with this:
ManyToOne(x => x.objPerson, map => { map.Column("PersonID"); map.NotNullable(false); });
Or if I want to prevent querying on the database by getting the whole object, I will just use this mapping instead:
Property(x => x.intPersonID, map => map.Column("PersonID"));
But combining them is not possible.