Bug 340610 - SQL script sequence generation from persistence.xml file - wrong starting value
Summary: SQL script sequence generation from persistence.xml file - wrong starting value
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL: http://forums.oracle.com/forums/threa...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 17:35 EDT by Guy Middleton CLA
Modified: 2022-06-09 10:28 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Middleton CLA 2011-03-21 17:35:11 EDT
Using Weblogic 11.1.1.3.0 on Linux with Toplink -- not sure which Eclipselink version this is.


I have an Entity class defined as follows:

@Entity
public class Serviceid implements Serializable {
    /* ... */
    @Id
    @Column(name = "SERVICEID_SEQ", nullable = false)
    @SequenceGenerator(name = "SEQ_SERVICEID", sequenceName = "SEQ_SERVICEID", allocationSize=1, initialValue=10000000)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_SERVICEID")
    private Integer serviceidSeq;
    /* ... */
}


Would like autogenerated SQL, here are the options in the persistence.xml file:

    <properties>
      <property name="eclipselink.target-database" value="Oracle11"/>
      <property name="eclipselink.target-server" value="WebLogic_10"/>
      <property name="javax.persistence.jtaDataSource" value="java:/app/jdbc/jdbc/NPP_IDMDS"/>
      <property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
      <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
      <property name="eclipselink.application-location" value="/home/guy/jdeveloper/mywork/JavaPersistenceTest/TopLinkTest/src/META-INF/"/>
    </properties>


When I run my application, Toplink writes a createDDL.jdbc file:
CREATE TABLE SERVICEID (SERVICEID_SEQ NUMBER(10) NOT NULL, COUNT_HWDEVICES NUMBER(10) NULL, SERVICE_CLASS VARCHAR2(10) NULL, SERVICEID_VALUE VARCHAR2(20) NULL, CREATE_DATE TIMESTAMP NULL, SERVICEID_TYPE VARCHAR2(10) NULL, COUNT_SWDEVICES NUMBER(10) NULL, PRIMARY KEY (SERVICEID_SEQ))
CREATE SEQUENCE SEQ_SERVICEID START WITH 1


Based on the "initialValue=10000000" parameter in my @SequenceGenerator tag, I would expect the sequence to start with 10000000, but instead it starts with 1.
Comment 1 Tom Ware CLA 2011-04-06 08:28:55 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:28:07 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink