All,
I am using Hibernate 3.2 with annotations and using an Oracle 10g database.
I read a legacy database table which has a column defined as a Number(6).
In my POJO class, if I map this column to a field of type Integer or Double, it doesnt work, it throws a ClassCastException. It works fine if I map it to a BigDecimal.
From the post at
http://forum.hibernate.org/viewtopic.php?t=967834&highlight=bigdecimal
I gather that Oracle Number types are always mapped to BigDecimal by hibernate. Is this true?
Because my confusion starts here. In my previous project (Which again used Hibernate with annotations), I had a table with a column declared as NUMBER(10) and that was mapped to a field of type Integer. That worked fine. So I am unable to figure out why this won't work.
Does anyone have any ideas?
In order to map a number to an Integer or Float and not a BigDecimal do any special annotations need to be specified? At present I am using just the @Column(name="name") annotation
Thanks in advance!