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

getting issue when we try to create a sequence on bigdecimal value in hibernate

 
Subramanian N V
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using the below code in the hbm file. the below id is the sequence created for the column, OEM_ID and the oemId is a Bigdecimal value.


<id name="oemId" type="big_decimal" >
<column name="OEM_ID" precision="22" scale="0" />
<generator class="sequence">
<param name="sequence">SLK_OEM_ID_SEQ</param>
</generator>
</id>

I am getting the below exception.
Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:78)

is there anything like , we cant generate sequence on a bigdecimal value?

Please help us if some one knows the answer.

thanks
Subbu
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the database data type definition if it maps to the correct hibernate type. http://www.tutorialspoint.com/hibernate/hibernate_mapping_types.htm

Also since you are using this type as a auto-increment primary key, will there be restrictions (eg say only allow using int and long types)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic