Home  >  Forum  >  Hibernate
Post New Query

The database returned no natively generated identity value



Asked on May 16, 2013
Hi Everyone,

I am using @GeneratedValue(strategy=GenerationType.IDENTITY) but got below error

The database returned no natively generated identity value
at org.hibernate.id.IdentifierGeneratorHelper.getGeneratedIdentity(IdentifierGeneratorHelper.java:84)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:98)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2836)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268)




Replied on May 16, 2013
You need to make you table's primary column auto increment.

Write Answer




©2019 concretepage.com | Privacy Policy | Contact Us