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

Auto increment from specifid number

 
Ghulam Rashid
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am wondering if we can tell hibernate to start incrementing the number for id column e.g. from 500 or any other, if we use <id> <generator class="increment"/>

Currently, my table is empty.

Any idea ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by using that generator type you are letting the database decide what the first and next numbers are, so at this point it is really a question of "how in your database can you configure the starting point of your auto-increment fields?"

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic