• 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: 17309
11
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!