Community
Participate
Working Groups
Build Identifier: Library: JPA 2.0 on Glassfish v3.0. Database & JDBC: Postgresql 8.4 and postgresql-8.4-701.jdbc4 JDK & OS: JDK 6 and Vista Home Basic. When I'm using initialValue on @SequenceGenerator annotation and use eclipselink.ddl-generation (create-tables) on persistence.xml, the generated sequence always ignore the initialValue attribute. This is my annotation: @SequenceGenerator(name="RoleSeq",sequenceName="seq_role",initialValue=100000) And this is the generated sequence: (start value is always *50*, not *100000*) CREATE SEQUENCE seq_role INCREMENT 50 MINVALUE 1 MAXVALUE 9223372036854775807 START *50* CACHE 1; Reproducible: Always Steps to Reproduce: 1. create sequence generator annotation on entity class: @SequenceGenerator(name="RoleSeq",sequenceName="seq_role",initialValue=10000) 2. use ddl-generation on persistence.xml: <property name="eclipselink.ddl-generation" value="create-tables"/> 3. run glassfish to make ddl running
Created attachment 166779 [details] Suggested patch (without test). Note that initialValue indicates the first sequence value that the app. will use - not the start value of the sequence in the db. If initialValue = 10000 and allocationSize = 50 the generated sequence will look like: CREATE SEQUENCE seq_role INCREMENT 50 START 10049 The first sequence value to be used by the app is 10049 - 50 + 1 = 10000.
Setting target and priority. See the following page for details of what these values mean. http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
suggested patch is already included in 2.1 - my tests indicate this functionality works with the patch
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink