JPA GeneratedValue with GenerationType.TABLE does a big jump after jvm restart
- by joeduardo
When I start my server and add an entry, the generated id will start with 1, 2, so on and so forth. After a restart, adding an entry would generate an id like 32,xxx. Another restart and adding of entry would generate an id like 65,xxx.
I don't know why this is happening.
Here's a snippet of the annotation I'm using for my id. I'm using Hibernate.
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private Long id;