Hello Ivan,

the idea behind getDecimal() not returning null is that we want to treat it 
like a native data type similar to int and double. For those two we cannot 
return null anyway, so why should we treat a decimal differently? This makes 
calculations in code more readable as in fact in math operations we can safely 
assume that a non existing number should be treated like zero.

I you need to know I would recommend that you call isNull(…) to determine if 
the value is not supplied.

Alternatively you always have the opportunity to call getValue() and check for 
null and if not do the type conversion yourself.

Regards

Rainer



 

Von: [email protected] [mailto:[email protected]] Im Auftrag von ivan 
nemeth
Gesendet: Donnerstag, 18. September 2014 12:37
An: user
Betreff: Re: Decimal Datatype with scale 10

 

Hi Rainer,

 

thanks for the info.

 

We're developing financial applications for fund management companies and 
prices are stored with scale 10 in our databases, and so our code is based on 
this.  It will be a lot of work to change it in our code, so if it will be 
fixed it's a good news for me. (Until then I subclassed DBTableColumn which 
overrides the validateNumber method, which caused the main problem.)

 

Other question regarding DECIMAL types.Why does the the 
DBRowSetData.getDecimal() method  return BigDecimal.ZERO (and not null like in 
Java ResultSet) when the db value is NULL? There is a clear difference between 
a null value and a ZERO value.

 

Thanks, 

Ivan

 

 

 

On Thu, Sep 18, 2014 at 9:05 AM, Rainer Döbele <[email protected]> wrote:

Hi Ivan,

 

this issue has already been reported.

Here’s the corresponding JIRA ticket:

https://issues.apache.org/jira/browse/EMPIREDB-208

 

At the moment I cannot offer a solution but we’re working on it.

 

Just for curiosity:

What application do you need that for?

i.e. what kind of information are you storing in that decimal and why do you 
need such long scales?

 

Regards

Rainer

 

 

from: [email protected] [mailto:[email protected]] Im Auftrag von ivan 
nemeth
to: user
re: Decimal Datatype with scale 10

 

Hi,

 

how can I define a DECIMAL column with scale 10?

 

Thanks,

Ivan

 

Reply via email to