org.apache.openjpa.jdbc.kernel
Class ValueTableJDBCSeq
java.lang.Object
   org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
       org.apache.openjpa.jdbc.kernel.TableJDBCSeq
org.apache.openjpa.jdbc.kernel.TableJDBCSeq
           org.apache.openjpa.jdbc.kernel.ValueTableJDBCSeq
org.apache.openjpa.jdbc.kernel.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 Summary | 
| static java.lang.String | PK_VALUE
 | 
 
 
 
 
 
| Method Summary | 
| protected  Column | addPrimaryKeyColumn(Table table)Add the primary key column to the given table and return it.
 | 
| protected  java.lang.Object | getPrimaryKey(ClassMapping mapping)Return the primary key value for the given class.
 | 
|  java.lang.String | getPrimaryKeyValue()The primary key value for this row.
 | 
| static void | main(java.lang.String[] args)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.
 | 
| static boolean | run(JDBCConfiguration conf,
    java.lang.String[] args,
    Options opts)Run the tool.
 | 
| static boolean | run(JDBCConfiguration conf,
    java.lang.String[] args,
    java.lang.String action,
    MappingRepository repos,
    java.lang.ClassLoader loader)Run the tool.
 | 
|  void | setPrimaryKeyValue(java.lang.String value)The primary key value for this row.
 | 
 
| Methods inherited from class org.apache.openjpa.jdbc.kernel.TableJDBCSeq | 
| addSchema, allocateInternal, currentInternal, dropTable, endConfiguration, executeQuery, executeUpdate, getAllocate, getConfiguration, getInitialValue, getPrimaryKeyColumn, getSequence, getSequence, getSequenceColumn, getStatus, getTable, getUniqueColumns, nextInternal, prepareStatement, refreshTable, resolveTableName, run, setAllocate, setConfiguration, setIncrement, setInitialValue, setPrimaryKeyColumn, setSequence, setSequenceColumn, setTable, setTableName, setUniqueColumns, startConfiguration | 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
PK_VALUE
public static final java.lang.String PK_VALUE
- See Also:
- Constant Field Values
ValueTableJDBCSeq
public ValueTableJDBCSeq()
getPrimaryKeyValue
public java.lang.String getPrimaryKeyValue()
- The primary key value for this row. Defaults to DEFAULT.
 
- 
 
setPrimaryKeyValue
public void setPrimaryKeyValue(java.lang.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:
- addPrimaryKeyColumnin class- TableJDBCSeq
 
- 
 
getPrimaryKey
protected java.lang.Object getPrimaryKey(ClassMapping mapping)
- Description copied from class: TableJDBCSeq
- Return the primary key value for the given class.
 
- 
- Overrides:
- getPrimaryKeyin class- TableJDBCSeq
 
- 
 
main
public static void main(java.lang.String[] args)
                 throws java.lang.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 JDBCConfigurationcan 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:
- 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,
                          MappingRepository repos,
                          java.lang.ClassLoader loader)
                   throws java.lang.Exception
- Run the tool. Return false if an invalid option was given.
 
- 
- Throws:
- java.lang.Exception
 
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.