Class ValueTableJDBCSeq

All Implemented Interfaces:
JDBCSeq, Seq, Configurable, Closeable

public class ValueTableJDBCSeq extends TableJDBCSeq
Specialization of the TableJDBCSeq that maintains multiple sequence counts. Each instance of this class represents one row with a known string primary key value, more or less. The table name defaults to OPENJPA_SEQUENCES_TABLE.
Author:
Abe White
  • Field Details

  • Constructor Details

    • ValueTableJDBCSeq

      public ValueTableJDBCSeq()
  • Method Details

    • getPrimaryKeyValue

      public String getPrimaryKeyValue()
      The primary key value for this row. Defaults to DEFAULT.
    • setPrimaryKeyValue

      public void setPrimaryKeyValue(String value)
      The primary key value for this row. Defaults to DEFAULT.
    • addPrimaryKeyColumn

      protected Column addPrimaryKeyColumn(Table table)
      Description copied from class: TableJDBCSeq
      Add the primary key column to the given table and return it.
      Overrides:
      addPrimaryKeyColumn in class TableJDBCSeq
    • getPrimaryKey

      protected Object getPrimaryKey(ClassMapping mapping)
      Description copied from class: TableJDBCSeq
      Return the primary key value for the sequence table for the given class.
      Overrides:
      getPrimaryKey in class TableJDBCSeq
    • main

      public static void main(String[] args) throws Exception
      Usage: java org.apache.openjpa.jdbc.kernel.ValueTableJDBCSeq [option]* -action/-a <add | drop | get | set> [primary key value] [value] Where the following options are recognized.
      • -properties/-p <properties file or resource>: The path or resource name of a OpenJPA properties file containing information such as the license key and 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. For example: -licenseKey adslfja83r3lkadf
      The various actions are as follows.
      • add: Create the sequence table.
      • drop: Drop the sequence table.
      • get: Print the current sequence value for the given primary key value.
      • set: Set the sequence value for the given primary key value.
      Throws:
      Exception
    • run

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

      public static boolean run(JDBCConfiguration conf, String[] args, String action, MappingRepository repos, ClassLoader loader) throws Exception
      Run the tool. Return false if an invalid option was given.
      Throws:
      Exception