-->
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: Patterns for mapping null NUMBER fields to primitive ints ?
PostPosted: Thu Mar 24, 2005 7:26 pm 
Newbie

Joined: Thu Mar 24, 2005 7:23 pm
Posts: 1
I have a legacy db scheme with a number of integers that are allowed to be NULL. Currently the domain objects use ints to store the data but this results in a NPE on teh binding. Is there a way to bind the mapping so it uses a default value (say 0) for a NULL NUMBER in the db, or do I need to promote the field from int to Integer? Does anyone have a pattern for handling these cases that they feel works well?

Thanks so much,

Jesper


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.