You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by sbedoll <be...@us.ibm.com> on 2009/08/08 11:23:44 UTC
double value truncated - Oracle 10g
I have the following column defined
@Column(name = "HOUSING_COST",precision=12,scale=2, nullable = true)
double housingCost;
I set the following value :
double housingCost = 1321360000.00;
This update statment generated is this:
UPDATE FPA2.GRID_POINT_COST_ATTR t0 SET HOUSING_COST = ? WHERE
(t0.GRID_POINT_ID = ?) [ (BigDecimal) 1.32136E+9, (long) 8028836]
The result in the database is : 13.21
If i change the column value to :
double housingCost = 1321360001.00;
This update statment generated is this:
UPDATE FPA2.GRID_POINT_COST_ATTR t0 SET HOUSING_COST = ? WHERE
(t0.GRID_POINT_ID = ?) [ (BigDecimal) 1321360001, (long) 8028836]
The result in the database is : 1321360001
Is this a JPA problem or Java problem? Its not an Oracle problem because
the following SQL updates the column to the correct value
UPDATE FPA2.GRID_POINT_COST_ATTR t0 SET HOUSING_COST = 1.32136E+9 WHERE
(t0.GRID_POINT_ID = 8028836)
--
View this message in context: http://n2.nabble.com/double-value-truncated---Oracle-10g-tp3408638p3408638.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.