Pages

Thursday, October 07, 2010

java.lang.ArithmeticException: Rounding necessary

I was working with JPA, Hibernate and Netbeans. Netbeans automatically generates the entity classes from the database. But the auto generator may confuses with the number type in oracle. Sometimes it generates BigInteger and sometimes BigDecimal. In my case the auto generator made the field BigInteger but actual value in the database was decimal. Thats why  java.lang.ArithmeticException: Rounding necessary. The variable types were changed from BigInteger to BigDecimal and the Exception was no more.

0 comments:

Post a Comment