Package org.apache.openjpa.jdbc.kernel
Class ValueTableJDBCSeq
java.lang.Object
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
org.apache.openjpa.jdbc.kernel.TableJDBCSeq
org.apache.openjpa.jdbc.kernel.ValueTableJDBCSeq
- All Implemented Interfaces:
JDBCSeq,Seq,Configurable,Closeable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.kernel.TableJDBCSeq
TableJDBCSeq.AllocateSequenceRunnable, TableJDBCSeq.CurrentSequenceRunnable, TableJDBCSeq.Status -
Field Summary
FieldsFields inherited from class org.apache.openjpa.jdbc.kernel.TableJDBCSeq
ACTION_ADD, ACTION_DROP, ACTION_GET, ACTION_SET, DEFAULT_TABLEFields inherited from class org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
current, typeFields inherited from interface org.apache.openjpa.kernel.Seq
TYPE_CONTIGUOUS, TYPE_DEFAULT, TYPE_NONTRANSACTIONAL, TYPE_TRANSACTIONAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ColumnaddPrimaryKeyColumn(Table table) Add the primary key column to the given table and return it.protected ObjectgetPrimaryKey(ClassMapping mapping) Return the primary key value for the sequence table for the given class.The primary key value for this row.static voidUsage: 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 booleanrun(JDBCConfiguration conf, String[] args, String action, MappingRepository repos, ClassLoader loader) Run the tool.static booleanrun(JDBCConfiguration conf, String[] args, Options opts) Run the tool.voidsetPrimaryKeyValue(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, getPrimaryKeyColumnIdentifier, getSequence, getSequence, getSequenceColumn, getStatus, getTable, getUniqueColumns, getUniqueConstraintIdentifier, getUniqueConstraintName, nextInternal, prepareStatement, refreshTable, resolveTableIdentifier, resolveTableName, run, setAllocate, setConfiguration, setIncrement, setInitialValue, setPrimaryKeyColumn, setSequence, setSequenceColumn, setTable, setTableName, setUniqueColumns, setUniqueConstraintName, setUniqueConstraintName, startConfigurationMethods inherited from class org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
allocate, close, closeConnection, current, getConnection, getConnection, next, setType, suspendInJTA
-
Field Details
-
PK_VALUE
- See Also:
-
-
Constructor Details
-
ValueTableJDBCSeq
public ValueTableJDBCSeq()
-
-
Method Details
-
getPrimaryKeyValue
The primary key value for this row. Defaults toDEFAULT. -
setPrimaryKeyValue
The primary key value for this row. Defaults toDEFAULT. -
addPrimaryKeyColumn
Description copied from class:TableJDBCSeqAdd the primary key column to the given table and return it.- Overrides:
addPrimaryKeyColumnin classTableJDBCSeq
-
getPrimaryKey
Description copied from class:TableJDBCSeqReturn the primary key value for the sequence table for the given class.- Overrides:
getPrimaryKeyin classTableJDBCSeq
-
main
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
- 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
- -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
-
run
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
-