Class NativeJDBCSeq

    • Constructor Detail

      • NativeJDBCSeq

        public NativeJDBCSeq()
    • Method Detail

      • getSequence

        public java.lang.String getSequence()
        The sequence name. Defaults to OPENJPA_SEQUENCE.
      • setSequence

        public void setSequence​(java.lang.String seqName)
        The sequence name. Defaults to OPENJPA_SEQUENCE.
      • startConfiguration

        public void startConfiguration()
        Description copied from interface: Configurable
        Invoked before bean property configuration is begun on this object.
        Specified by:
        startConfiguration in interface Configurable
      • endConfiguration

        public void endConfiguration()
        Description copied from interface: Configurable
        Invoked upon completion of bean property configuration for this object.
        Specified by:
        endConfiguration in interface Configurable
      • allocateInternal

        protected void allocateInternal​(int additional,
                                        JDBCStore store,
                                        ClassMapping mapping)
                                 throws java.sql.SQLException
        Allocate additional sequence values.
        Overrides:
        allocateInternal in class AbstractJDBCSeq
        Parameters:
        additional - ignored - the allocation size is fixed and determined by allocate and increment properties.
        store - used to obtain connection
        mapping - ignored
        Throws:
        java.sql.SQLException
      • refreshSequence

        public void refreshSequence()
                             throws java.sql.SQLException
        Creates the sequence in the DB.
        Throws:
        java.sql.SQLException
      • dropSequence

        public void dropSequence()
                          throws java.sql.SQLException
        Drops the sequence in the DB.
        Throws:
        java.sql.SQLException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Usage: java org.apache.openjpa.jdbc.schema.NativeJDBCSequence [option]* -action/-a <add | drop | get> Where the following options are recognized.
        • -properties/-p <properties file or resource>: The path or resource name of an OpenJPA properties file containing information such as connection data as outlined in JDBCConfiguration. Optional.
        • -<property name> <property value>: All bean properties of the OpenJPA JDBCConfiguration can be set by using their names and supplying a value.
        The various actions are as follows.
        • add: Create the sequence.
        • drop: Drop the sequence.
        • get: Print the next sequence value.
        Throws:
        java.lang.Exception
      • run

        public static boolean run​(JDBCConfiguration conf,
                                  java.lang.String[] args,
                                  Options opts)
                           throws java.lang.Exception
        Run the tool. Returns false if invalid options were given.
        Throws:
        java.lang.Exception
      • run

        public static boolean run​(JDBCConfiguration conf,
                                  java.lang.String[] args,
                                  java.lang.String action)
                           throws java.lang.Exception
        Run the tool. Returns false if an invalid option was given.
        Throws:
        java.lang.Exception
      • setSchema

        @Deprecated
        public void setSchema​(java.lang.String schema)
        Deprecated.
      • getSchema

        @Deprecated
        public java.lang.String getSchema()
        Deprecated.
      • getSchemaIdentifier

        public DBIdentifier getSchemaIdentifier()