Hi,
I have read
online:
Quote:
If you want to use NHibernate with .Net 2.0 Nullable Types (int?, DateTime?, etc), all you need to do is to specify full type name of the (non nullable) property.
So, if you've something like "DateTime? DueDate { get; set; }", the mapping will looks something like this: "<propery name='DueDate' type='System.DateTime'/>"
You don't need to do anything else.
Here is my problem now. I have mapped a database table [Cutting], which amongst other fields has got one called 'ClientID'. Now I am trying to load an Entity from another database which have the same [Cutting] table as the one used to configure Nhibernate BUT with the 'ClientID' field missing.
However because it is marked as nullable in my Entity class, it should not cause any harm. But when I call :
Code:
_session.Get<Cutting>(cuttingId);
I get the following exception :
Quote:
could not load an entity. Invalid column name 'ClientID'.
This is how I mapped my ClientID field in the hbm.xml file :
Quote:
<property type="int" name="Clientid" column="[ClientID]" />
What am doing wrong here ?
Thanks