org.apache.openjpa.jdbc.kernel
Class ClassTableJDBCSeq

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.ClassTableJDBCSeq
All Implemented Interfaces:
JDBCSeq, Seq, Configurable, Closeable

public class ClassTableJDBCSeq
extends TableJDBCSeq

Specialization of the TableJDBCSeq that maintains a separate sequence count per-class. 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
 
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
ClassTableJDBCSeq()
           
 
Method Summary
protected  Column addPrimaryKeyColumn(Table table)
          Add the primary key column to the given table and return it.
 boolean getIgnoreUnmapped()
          Whether unmapped classes should be ignored as possible primary key values in the table.
protected  Object getPrimaryKey(ClassMapping mapping)
          Return the primary key value for the sequence table for the given class.
protected  TableJDBCSeq.Status getStatus(ClassMapping mapping)
          Return the appropriate status object for the given class, or null if cannot handle the given class.
 boolean getUseAliases()
          Whether to use type alises for primary key values in place of class names.
static void main(String[] args)
          Usage: java org.apache.openjpa.jdbc.kernel.ClassTableJDBCSeq [option]* -action/-a <add | drop | get | set> [class name | .java file | .class file | .jdo file] [value] Where the following options are recognized.
static boolean run(JDBCConfiguration conf, String[] args, Options opts)
          Run the tool.
static boolean run(JDBCConfiguration conf, String[] args, String action, MappingRepository repos, ClassLoader loader)
          Run the tool.
 void setIgnoreUnmapped(boolean ignore)
          Whether unmapped classes should be ignored as possible primary key values in the table.
 void setIgnoreVirtual(boolean ignore)
          Deprecated. Use setIgnoreUnmapped(boolean). Retained for backwards-compatibility for auto-configuration.
 void setUseAliases(boolean aliases)
          Whether to use type alises for primary key values in place of class names.
 
Methods inherited from class org.apache.openjpa.jdbc.kernel.TableJDBCSeq
addSchema, allocateInternal, currentInternal, dropTable, endConfiguration, getAllocate, getConfiguration, getInitialValue, getPrimaryKeyColumn, getSequence, getSequenceColumn, getTable, nextInternal, refreshTable, resolveTableName, run, setAllocate, setConfiguration, setIncrement, setInitialValue, setPrimaryKeyColumn, setSequence, setSequenceColumn, setTable, setTableName, startConfiguration
 
Methods inherited from class org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq
allocate, close, closeConnection, current, getConnection, next, setType, suspendInJTA
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassTableJDBCSeq

public ClassTableJDBCSeq()
Method Detail

getIgnoreUnmapped

public boolean getIgnoreUnmapped()
Whether unmapped classes should be ignored as possible primary key values in the table. Defaults to false.


setIgnoreUnmapped

public void setIgnoreUnmapped(boolean ignore)
Whether unmapped classes should be ignored as possible primary key values in the table. Defaults to false.


setIgnoreVirtual

public void setIgnoreVirtual(boolean ignore)
Deprecated. Use setIgnoreUnmapped(boolean). Retained for backwards-compatibility for auto-configuration.


getUseAliases

public boolean getUseAliases()
Whether to use type alises for primary key values in place of class names. Defaults to false.


setUseAliases

public void setUseAliases(boolean aliases)
Whether to use type alises for primary key values in place of class names. Defaults to false.


getStatus

protected TableJDBCSeq.Status getStatus(ClassMapping mapping)
Description copied from class: TableJDBCSeq
Return the appropriate status object for the given class, or null if cannot handle the given class. The mapping may be null.

Overrides:
getStatus in class TableJDBCSeq

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.ClassTableJDBCSeq [option]* -action/-a <add | drop | get | set> [class name | .java file | .class file | .jdo file] [value] Where the following options are recognized. The various actions are as follows.

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


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.