Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Issue - java.lang.ClassCastException: org.hibernate.type.BigDecimalType

 
Eric Koni
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

When I was testing my database connection (Oracle Database 10g (10.2.0.4)) I received the following error:

From Models

java.lang.ClassCastException: org.hibernate.type.BigDecimalType

I have the correct driver. The table has an ID column and its type is “NUMERIC” which maps to a big_decimal (hbm.xml) then to the POJO (java.math.BigDecimal). Everything looks fine. I even tried changing the column type to “LONG” and I still receive the ‘noted above’ error message.

Additionally, I’m able to successfully query other tables that do not contain a column type of “NUMERIC”.

I’m really stumped; any insight you can provide would be greatly appreciated.
javascript:emoticon('');

Thanks,
Eric
 
Girish Wakure
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post code of hbm file, and POJO Class Attributes. Also Full Error Code
 
Eric Koni
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Girish,

I fixed it. I had to remove the “VERSION” property from two of my HBM files and their associated POJO’s; now all is well

Thank you very much for replying to my post, I really appreciated it.

JavaRanch Rocks!

Bests,
Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic