JPA GeneratedValue with GenerationType.TABLE does a big jump after jvm restart
Posted
by joeduardo
on Stack Overflow
See other posts from Stack Overflow
or by joeduardo
Published on 2010-05-23T15:36:36Z
Indexed on
2010/05/23
15:41 UTC
Read the original article
Hit count: 173
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;
© Stack Overflow or respective owner