Joined: Sun May 08, 2005 10:00 pm Posts: 1
|
I am accessing third party data base with a many to one(child - parent) relationship. The column that references the relationship is set to 0 as a default rather than leaving it null. When hibernate sees non-null key it tries to access the record and it fails with UnresolvableObjectException: No row with the given identifier exists: 0,
How can I make hibernate recognize 0 as indicator that parent does not exist. I tried using check parameter and it has no effect.
Here is the mapping for the relationship
<many-to-one name="parentItem"
cascade="none"
update="false"
insert="false"
outer-join="false"
not-null="false">
<column name="ParentItem"
not-null="false" check="ParentItem > 0"/>
</many-to-one>
Thanks
|
|