Hi There...
I am on a situation that when saving data using hibernate I am loosing precision. I'm trying to save the value 99,999,999.99 but it keeps saving 100,000,000 at database.
I changed mapping from double to BigDecimal, changed the bean also, but it did not helped too much. I've made the scale precision at code, but it did not solved too.
I am using hibernate 2, DB2 7.1.
The collumn type at DB2 is decimal (15,2).
The code saving data is:
Code:
session = getSessionFactory().openSession();
transaction = session.beginTransaction();
session.save(bean.getShipping());
session.save(bean.getBilling());
session.save(bean);
transaction.commit();
I've tried a lot of solutions but hibernate keeps rounding my numbers.
The collumns at mapping are like this :
Code:
<property name="totalPrice" column="TOTAL_PRICE" type="big_decimal" length="2"/>
<property name="subTotal" column="SUB_TOTAL" type="big_decimal" length="2"/>
The length="2" I've just put now for testing purpose but it did not chaged the behavior.
Appreciate any help!!!