-->
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: number columns that can be null; map them to string props?
PostPosted: Mon Aug 07, 2006 6:31 pm 
Regular
Regular

Joined: Mon Aug 07, 2006 6:22 pm
Posts: 67
Using Hibernate 3.0.5 and JDK 1.4.2.

I'm new to Hibernate. I haven't gotten into the refdoc yet.

I have an Oracle table with two columns that are defined as NUMBER, but they are nullable, and one or more of them will often be null. If I do a straightforward mapping, it would be to an "int" property, but that won't work, as I need to know if the value is null or not.

Can I map the NUMBER columns to String properties? If the column value is null, then the String value will be null, correct? Is this the best strategy to map this table?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 11:46 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Best strategy is to map them as Integers.

_________________
Code tags are your friend. Know them and use them.


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.