-->
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.  [ 3 posts ] 
Author Message
 Post subject: convert NULL to 0 with integer type
PostPosted: Thu Sep 29, 2005 4:49 pm 
Newbie

Joined: Thu Sep 29, 2005 4:40 pm
Posts: 1
Hibernate version: 3

Mapping documents: <property name="age" column="age" type="integer"/>

I have to support an old database with a poor design. In the old EJB implementation there are several columns that have int or long mapped to a nullable database column. For now I need to simply convert any nulls I encounter to 0 is it possible to do this with an integer type?

If not can I do this with a custom datatype? If so where can I find a good examlpe?

Thanks!

Jamey...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 5:30 pm 
Beginner
Beginner

Joined: Tue Sep 06, 2005 5:16 pm
Posts: 24
Location: USA
If you are using java beans ..simply modify the default values of the properties from null to 0..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 5:33 pm 
Beginner
Beginner

Joined: Tue Apr 05, 2005 4:27 pm
Posts: 40
Location: canada
use a usertype...

maybe try to contact the poster of this topic:
http://forum.hibernate.org/viewtopic.php?t=947860&highlight=
to see if they got theirs done.

if not, search the wiki for examples.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.