Community
Participate
Working Groups
JSR 317: JavaTM Persistence API, Version 2.0 11.1.46 TableGenerator Annotation TableGenerator Annotation Elements: ================================================================================ Type Name Description Default int initialValue (Optional) The value used to initialize the 0 column that stores the last value generated. ================================================================================ So I think initialValue of TableGenerator is the last value stored in DB, and the first number generated should be initialValue + 1. ---------------------------------------------------------------------- Example: ---------------------------------------------------------------------- @TableGenerator(name="SEQ_GEN", table="OTHER_SEQ_GEN", pkColumnName="OTHER_SEQ_NAME", valueColumnName="OTHER_SEQ_GEN", pkColumnValue="OTHER_SEQ_COUNT", initialValue=50, allocationSize=10) current SQL: INSERT INTO OTHER_SEQ_GEN(OTHER_SEQ_NAME, OTHER_SEQ_GEN) values ('OTHER_SEQ_COUNT', 49) current first number generated: 50 right SQL: INSERT INTO OTHER_SEQ_GEN(OTHER_SEQ_NAME, OTHER_SEQ_GEN) values ('OTHER_SEQ_COUNT', 50) right first number generated: 51
As designed. initialValue is "the initial value". That is exactly what is described above.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink