jsr338-experts@jpa-spec.java.net

[jsr338-experts] Arbitrary precsion value in JPA

From: Pinaki Poddar <ppoddar_at_us.ibm.com>
Date: Mon, 4 Feb 2013 10:16:51 -0800

Hello,

The spec should mention some more details about the value of a persistent
property of arbitrary-precision numbers such as BigDecimal type.

For example, if the application defines a BigDecimal field with scale = 2
and sets a value of 1234.56789, then
a) will the value be stored in database as 1234.56 (i.e. losing precision)?

b) If the field were declared without a scale parameter, then would the
column value be the same as the in-memory value of 1234.56789?

c) If the provider is responsible for rounding the in-memory value, then
what is the rounding mode?

I have few more questions, but as a starter if some clarifications are
available for the above questions, it will be helpful.

Regards --

Pinaki Poddar
Chair, Apache OpenJPA Project http://openjpa.apache.org/
JPA Expert Group Member