How to set the initial value for auto-zoom in sleep mode
I am new to hibernate. How do I specify in Hibernate the initial value of my id (say 100000) and automatically increment the id starting with that value in my code. Any help on this is appreciated.
@Id
@Column (name = "ID")
@GeneratedValue(generator="increment")
@GenericGenerator(name="increment", strategy = "increment")
private Integer ID;
+3
source to share
3 answers
Try this: http://www.java2s.com/Code/Java/JPA/SetInitialValueOfTableGenerator.htm
JPA has @TableGenerator annotation where you can set the initial value.
+1
source to share