I’m using H2 for testing environment my app. I have table Order and i would like start order id from 10000. I created Table Column:
@Id @TableGenerator(name = "ORDER_GEN", table = "ID_GEN", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_NUMBER", pkColumnValue = "ORDER_GEN", initialValue = 1000) @GeneratedValue(strategy = GenerationType.TABLE, generator = "ORDER_GEN") private Long orderId;
but doesn’t work. I restarted app, table ID_GEN was created but order each time starting from 0.
Any ideas ?
I found solution here:
The problem is with hibernate bug.
After added setting to application.properties:
everything works very well.