• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieve Entity's Auto-Increment Id

 
Yiorgos Panayiotakis
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a rather common problem I think. I want to retrieve my Entity's next (auto-incremented) id without actually persisting the entity.
How is this possible to retrieve an auto increment key before persisting to the database ?

Do i need to use any special annotation on the Entity's id for this purpose ?

Btw I'm using mysql 5 as the underlying database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic