-->
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: Alternative null value for references?
PostPosted: Thu May 15, 2008 4:14 pm 
Newbie

Joined: Thu May 15, 2008 3:59 pm
Posts: 1
Hibernate version: 3.2

Hello,

I got a legacy database with uses Varchar2 Columns for FKs. The application using the database uses the string "-" for not existing references in one-to-one relationships instead of null.

Currently I have no idea, how to define a mapping, so that I can interpret the minus character as a null reference, accept overloading half of the hibernate type system.

Does any one faced such a problem before? How did you solved it?

I appreciate any answer.

Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 16, 2008 2:46 am 
Regular
Regular

Joined: Thu Mar 06, 2008 5:06 am
Posts: 68
I think the unsaved-value property in the mapping of the primary key is the right one for you:

Code:
<id ...  unsaved-value="-"/>


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.