0

PFB my code,

@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="empIdSequence")
    @SequenceGenerator(name="empIdSequence",initialValue=10000,allocationSize=1)
    private Integer empId;

I am using EclipseLink 2.5.x implementation and MySQL Database. When i create a record the empId starts from 1 instead of 10000. Is there any other configuration that i need to do ?

JPS
  • 2,730
  • 5
  • 32
  • 54

1 Answers1

1

To prevent conflicts everytime you restart your application or spin up a new instance somewhere, the intialValue is only used when creating the sequence generator in the database, when the tables are dropped and created.

Chris
  • 20,138
  • 2
  • 29
  • 43