I am developing an application using oracle 11g, Java (struts2) and Hibernate.
I have a table called mytemp with a column mytemp_id that is of type NUMBER (22.0).
In my file mytemp.hbm.xml the file is listed 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, a database is created with the name "MYTEMP_TEMP_ID_SEQ", which works fine in Oracle.
Now when I try to insert a record using sleep mode, it gives me the following error
org.hibernate.id.IdentifierGenerationException: this id generator throws long, integer, short or string
It seems that as my sequence returns Number, hibenate treats it as BigDecimal, and the sleep generator class allocates values that are long, integer, short, and string.
Hibernation should not have a problem with BigDecimal. But I think they did not implement BigDecimal for the sequence generator
Can someone help me solve the problem?
Thanks.
source
share