org.apache.openjpa.jdbc.kernel
Class ValueTableJDBCSeq

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
      extended by org.apache.openjpa.jdbc.kernel.TableJDBCSeq
          extended by org.apache.openjpa.jdbc.kernel.ValueTableJDBCSeq
All Implemented Interfaces:
JDBCSeq, org.apache.openjpa.kernel.Seq, org.apache.openjpa.lib.conf.Configurable, org.apache.openjpa.lib.util.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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.kernel.TableJDBCSeq
TableJDBCSeq.Status
 
Field Summary
static java.lang.String PK_VALUE
           
 
Fields inherited from class org.apache.openjpa.jdbc.kernel.TableJDBCSeq
ACTION_ADD, ACTION_DROP, ACTION_GET, ACTION_SET
 
Fields inherited from class org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
current, type
 
Fields inherited from interface org.apache.openjpa.kernel.Seq
TYPE_CONTIGUOUS, TYPE_DEFAULT, TYPE_NONTRANSACTIONAL, TYPE_TRANSACTIONAL
 
Constructor Summary
ValueTableJDBCSeq()
           
 
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, org.apache.openjpa.lib.util.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, getAllocate, getConfiguration, getPrimaryKeyColumn, getSequence, getSequenceColumn, getStatus, getTable, nextInternal, refreshTable, run, setAllocate, setConfiguration, setIncrement, setPrimaryKeyColumn, setSequence, setSequenceColumn, setTable, setTableName, startConfiguration
 
Methods inherited from class org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
allocate, close, closeConnection, current, getConnection, next, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PK_VALUE

public static final java.lang.String PK_VALUE
See Also:
Constant Field Values
Constructor Detail

ValueTableJDBCSeq

public ValueTableJDBCSeq()
Method Detail

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:
addPrimaryKeyColumn in 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:
getPrimaryKey in 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. The various actions are as follows.

Throws:
java.lang.Exception

run

public static boolean run(JDBCConfiguration conf,
                          java.lang.String[] args,
                          org.apache.openjpa.lib.util.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 Apache Software Foundation. All Rights Reserved.