Hello friends,
I am developing an application using oracle 11g, Java(struts2) and Hibernate.
I have table named mytemp with column mytemp_id which is of type NUMBER(22,0).
In my mytemp.hbm.xml file id is as given below
<id name="mytempId" type="big_decimal">
<column name="MYTEMP_ID" precision="22" scale="0" />
<generator class="sequence">
<param name="sequence">MYTEMP_TEMP_ID_SEQ</param>
</generator>
</id>
In my Oracle database sequence named "MYTEMP_TEMP_ID_SEQ" is created and working fine in Oracle.
Now when I try to insert record using hibernate, it gives me following error
org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
It seems that as my sequence returns Number, hibenate considering it as BigDecimal, while hibernate's sequece generator class considering values that are long, integer, short and string only.
Hibernate should not have problem with BigDecimal. But I think they have not implemented BigDecimal for sequence generator
Can any one help me solving the problem?
Thanks.