org.eclipse.persistence.sequencing
Class TableSequence

java.lang.Object
  extended by org.eclipse.persistence.sequencing.Sequence
      extended by org.eclipse.persistence.sequencing.StandardSequence
          extended by org.eclipse.persistence.sequencing.QuerySequence
              extended by org.eclipse.persistence.sequencing.TableSequence
All Implemented Interfaces:
Serializable, Cloneable

public class TableSequence
extends QuerySequence

Purpose: Defines sequencing through using a SEQUENCE table.

Description This is the default sequencing mechanism. A table defaulting to SEQUENCE is used to generate unique ids. The table has a name field (SEQ_NAME) storing each sequences name, and a counter (SEQ_COUNT) storing the last sequence id generated. There will be a row in the table for each sequence object.

See Also:
Serialized Form

Field Summary
static String defaultTableName
          Deprecated. Use an empty string as a default sequence table name instead, that triggers usage of platform.getDefaultSequenceTableName() when the sequence is connected.
 
Constructor Summary
TableSequence()
           
TableSequence(String name)
          Create a new sequence with the name.
TableSequence(String name, int size)
          Create a new sequence with the name and sequence pre-allocation size.
TableSequence(String name, int size, int initialValue)
           
TableSequence(String name, int size, String tableName)
           
TableSequence(String name, int size, String tableName, String nameFieldName, String counterFieldName)
           
TableSequence(String name, String tableName)
          Create a new sequence with the name, and the sequence table name.
TableSequence(String name, String tableName, String nameFieldName, String counterFieldName)
          Create a new sequence with the name, and the sequence table information.
 
Method Summary
 boolean equals(Object obj)
           
 String getCounterFieldName()
           
 String getNameFieldName()
           
 String getQualifiedTableName()
           
 org.eclipse.persistence.internal.helper.DatabaseTable getTable()
           
 String getTableName()
           
 boolean isTable()
           
 void onConnect()
          INTERNAL:
 void setCounterFieldName(String name)
           
 void setNameFieldName(String name)
           
 void setTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
           
 void setTableName(String name)
           
 
Methods inherited from class org.eclipse.persistence.sequencing.QuerySequence
getSelectQuery, getUpdateQuery, onDisconnect, setSelectQuery, setShouldAcquireValueAfterInsert, setShouldSelectBeforeUpdate, setShouldSkipUpdate, setShouldUseTransaction, setUpdateQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction
 
Methods inherited from class org.eclipse.persistence.sequencing.StandardSequence
getGeneratedValue, getGeneratedVector, setInitialValue
 
Methods inherited from class org.eclipse.persistence.sequencing.Sequence
clone, equalNameAndSize, getDatasourcePlatform, getGeneratedValue, getGeneratedVector, getInitialValue, getName, getPreallocationSize, getQualified, getQualifier, isConnected, isCustomQualifier, isNative, isUnaryTable, onConnect, onDisconnect, setName, setPreallocationSize, setQualifier, setShouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldUsePreallocation, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultTableName

public static final String defaultTableName
Deprecated. Use an empty string as a default sequence table name instead, that triggers usage of platform.getDefaultSequenceTableName() when the sequence is connected.
Default sequence table name

See Also:
Constant Field Values
Constructor Detail

TableSequence

public TableSequence()

TableSequence

public TableSequence(String name)
Create a new sequence with the name.


TableSequence

public TableSequence(String name,
                     int size)
Create a new sequence with the name and sequence pre-allocation size.


TableSequence

public TableSequence(String name,
                     int size,
                     int initialValue)

TableSequence

public TableSequence(String name,
                     String tableName)
Create a new sequence with the name, and the sequence table name.


TableSequence

public TableSequence(String name,
                     String tableName,
                     String nameFieldName,
                     String counterFieldName)
Create a new sequence with the name, and the sequence table information.


TableSequence

public TableSequence(String name,
                     int size,
                     String tableName)

TableSequence

public TableSequence(String name,
                     int size,
                     String tableName,
                     String nameFieldName,
                     String counterFieldName)
Method Detail

isTable

public boolean isTable()
Overrides:
isTable in class Sequence

equals

public boolean equals(Object obj)
Overrides:
equals in class QuerySequence

getCounterFieldName

public String getCounterFieldName()

setCounterFieldName

public void setCounterFieldName(String name)

getNameFieldName

public String getNameFieldName()

setNameFieldName

public void setNameFieldName(String name)

getTable

public org.eclipse.persistence.internal.helper.DatabaseTable getTable()

getTableName

public String getTableName()

getQualifiedTableName

public String getQualifiedTableName()

setTable

public void setTable(org.eclipse.persistence.internal.helper.DatabaseTable table)

setTableName

public void setTableName(String name)

onConnect

public void onConnect()
Description copied from class: QuerySequence
INTERNAL:

Overrides:
onConnect in class QuerySequence