Hello,
given the following mapping:
Code:
<class name="Product, MyObjects" table="Products">
<id name="Id" column="RecID" type="System.Int64">
<generator class="native" />
</id>
<many-to-one name="Part" class="Part, MyObjects" column="PartID" />
</class>
<class name="Part, MyObjects" table="Parts">
<id name="Id" column="RecID" type="System.Int64">
<generator class="native" />
</id>
...
</class>
We have records, where Products.PartID is 0 and there doesn't exist a record in Parts with Parts.RecID == 0. We all know Products.PartID should be NULL in such cases, but my program is not the only one working on that database...
The problem: when I try to get a record from Products, I get the the following error if Products.PartID does not exist in Parts.RecID:
Quote:
{"No row with the given identifier exists: 0, of class: Part" }
Is there any option to do a outer join and ignore the missing foreign keys? Can I NHibernate something like "treat 0 as NULL"?
Sincerely,
Stefan Lieser