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

net.sf.hibernate.MappingException: Dialect does not support identity key generation

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Does anyone know why this exception would be thrown...



This exception is not being thrown from my code. I am calling an API and that stupid API is throwing this exception. So I really don't have anything else to go by other than this stacktrace.

I am guessing it is because there is something wrong with my Eclipse build path. Any suggestions would be appreciated.

Thanks in advance for any help,
Jehan
 
Dragan Jovanovic
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe it is exactly what is written. Which database server do you use ? Does it support autoincrementing values for keys ?
If it doesn't, maybe appropriate hibernate sql dialect also does not support it. Which sql dialect do you use with hibernate ?
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some databases like Oracle don't support identity columns while some others like DB2 do support it.
So, if you try to use 'identity' generation strategy, hibernate will give the error.
Use some other generation strategy instead...
 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your responses. But I am using DB2 which supports identity, so I do not know why I am still getting this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic