Class TableSequence
java.lang.Object
org.eclipse.persistence.sequencing.Sequence
org.eclipse.persistence.sequencing.StandardSequence
org.eclipse.persistence.sequencing.QuerySequence
org.eclipse.persistence.sequencing.TableSequence
- All Implemented Interfaces:
Serializable,Cloneable
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringHold the name of the column in the sequence table which specifies the sequence numeric valuestatic final StringDeprecated.Use an empty string as a default sequence table name instead, that triggers usage of platform.getDefaultSequenceTableName() when the sequence is connected.protected StringHold the name of the column in the sequence table which specifies the sequence nameprotected org.eclipse.persistence.internal.helper.DatabaseTableHold the database tableFields inherited from class org.eclipse.persistence.sequencing.QuerySequence
selectQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction, updateQuery, wasSelectQueryCreated, wasUpdateQueryCreatedFields inherited from class org.eclipse.persistence.sequencing.Sequence
depth, initialValue, isCustomQualifier, name, platform, qualifier, shouldAlwaysOverrideExistingValue, size -
Constructor Summary
ConstructorsConstructorDescriptionTableSequence(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
Modifier and TypeMethodDescriptionprotected ValueReadQueryINTERNAL:protected DataModifyQueryINTERNAL:booleanorg.eclipse.persistence.internal.helper.DatabaseTablegetTable()inthashCode()booleanisTable()voidINTERNAL:voidsetCounterFieldName(String name) voidsetNameFieldName(String name) voidsetTable(org.eclipse.persistence.internal.helper.DatabaseTable table) voidsetTableName(String name) Methods inherited from class org.eclipse.persistence.sequencing.QuerySequence
buildSelectQuery, buildUpdateQuery, createArguments, getSelectQuery, getUpdateQuery, onDisconnect, select, setSelectQuery, setShouldAcquireValueAfterInsert, setShouldSelectBeforeUpdate, setShouldSkipUpdate, setShouldUseTransaction, setUpdateQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction, update, updateAndSelectSequenceMethods inherited from class org.eclipse.persistence.sequencing.StandardSequence
createVector, createVectorAtNextVal, getGeneratedValue, getGeneratedVector, setInitialValueMethods inherited from class org.eclipse.persistence.sequencing.Sequence
clone, equalNameAndSize, getDatasourcePlatform, getGeneratedValue, getGeneratedVector, getInitialValue, getName, getPreallocationSize, getQualified, getQualifier, isConnected, isCustomQualifier, isNative, isUnaryTable, onConnect, onDisconnect, setDatasourcePlatform, setName, setPreallocationSize, setQualifier, setShouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldUsePreallocation, toString, verifyPlatform
-
Field Details
-
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:
-
table
protected org.eclipse.persistence.internal.helper.DatabaseTable tableHold the database table -
counterFieldName
Hold the name of the column in the sequence table which specifies the sequence numeric value -
nameFieldName
Hold the name of the column in the sequence table which specifies the sequence name
-
-
Constructor Details
-
TableSequence
public TableSequence() -
TableSequence
Create a new sequence with the name. -
TableSequence
Create a new sequence with the name and sequence pre-allocation size. -
TableSequence
-
TableSequence
Create a new sequence with the name, and the sequence table name. -
TableSequence
Create a new sequence with the name, and the sequence table information. -
TableSequence
-
TableSequence
-
-
Method Details
-
isTable
public boolean isTable() -
equals
- Overrides:
equalsin classQuerySequence
-
hashCode
public int hashCode()- Overrides:
hashCodein classQuerySequence
-
getCounterFieldName
-
setCounterFieldName
-
getNameFieldName
-
setNameFieldName
-
getTable
public org.eclipse.persistence.internal.helper.DatabaseTable getTable() -
getTableIndexes
-
getTableName
-
getQualifiedTableName
-
setTable
public void setTable(org.eclipse.persistence.internal.helper.DatabaseTable table) -
setTableName
-
onConnect
public void onConnect()Description copied from class:QuerySequenceINTERNAL:- Overrides:
onConnectin classQuerySequence
-
buildSelectQuery
Description copied from class:QuerySequenceINTERNAL:- Overrides:
buildSelectQueryin classQuerySequence
-
buildUpdateQuery
Description copied from class:QuerySequenceINTERNAL:- Overrides:
buildUpdateQueryin classQuerySequence
-