-->
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: Numeric Column with default values and searchable
PostPosted: Thu Sep 24, 2009 1:48 am 
Newbie

Joined: Thu Sep 24, 2009 12:46 am
Posts: 10
Hi,

i have a dashboard which shows the amount column which is of numeric type, there is a possibility of null values for amount in db, so i am showing null values as 0.00 thru my java code, while user searches the dashboard whose amount is 0.00 he needs to show all the 0.00 values(null values in DB).

i want a hibernate configuration to display the null numeric values as 0 (in read mode only) and when user searches on zero he can able to see those values.

I am asking this because i have lot of columns now of numeric type which needs to satisfy above functionality. Is it possible

Thanks in Advance.


Top
 Profile  
 
 Post subject: Re: Numeric Column with default values and searchable
PostPosted: Fri Sep 25, 2009 2:43 am 
Newbie

Joined: Thu Sep 24, 2009 12:46 am
Posts: 10
hi,

I want to know when i fired Select HQL query the columns which are null should have default value..?

i am also used "column" element "default" attribute which is not working for me.


Top
 Profile  
 
 Post subject: Re: Numeric Column with default values and searchable
PostPosted: Fri Sep 25, 2009 10:21 am 
Beginner
Beginner

Joined: Wed Jul 09, 2008 5:34 am
Posts: 41
Location: Brno, Czech Republic
You can provide an implementation of DiscriminatorType, and convert "null" to 0.00. But honestly, think twice before doing that :-) Most of the times, it is better to treat those special cases only in special places (like the UI or in the query the user is doing). Doing it "system wide" may not be a good solution.


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.