-->
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.  [ 1 post ] 
Author Message
 Post subject: Legacy database where 0 means NULL
PostPosted: Mon Oct 18, 2004 7:02 pm 
Newbie

Joined: Mon Oct 18, 2004 6:55 pm
Posts: 2
Using Hibernate 2.1.6.

I've got a legacy database (that I can't easily cleanup) that has null-value keys mapped as '0's. Hibernate rightfully complains when it tries to build the associated object based on what it thinks is a key of 0:

Code:
net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 0


I think I'm supposed to use a UserType to get around this, but I'm just not certain how.. can someone give me the high-level view of how a UserType would work here, since the Integer maps to an object that needs to be retrieved?

thanks..


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

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.