• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic