Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Auto increment from specifid number  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!