-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: many to one with 0 rather than null as empty key
PostPosted: Sun May 08, 2005 10:17 pm 
Newbie

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 09, 2005 6:02 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
not-found="ignore"

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.