java.lang.Object
org.eclipse.persistence.sequencing.Sequence
org.eclipse.persistence.sequencing.StandardSequence
org.eclipse.persistence.sequencing.QuerySequence
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
EISSequence,NativeSequence,TableSequence,UnaryTableSequence
Purpose: An generic query sequence mechanism.
Description This sequence allows the sequence operations to be customized through user defined queries. A select and update query can be set which can use custom SQL or stored procedures to define the sequencing mechanism. If a single stored procedure is used that does the update and select only the select query needs to be set.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ValueReadQueryprotected booleanprotected booleanprotected booleanprotected booleanprotected DataModifyQueryprotected booleanprotected booleanFields inherited from class org.eclipse.persistence.sequencing.Sequence
depth, initialValue, isCustomQualifier, name, platform, qualifier, shouldAlwaysOverrideExistingValue, size -
Constructor Summary
ConstructorsConstructorDescriptionQuerySequence(boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) QuerySequence(String name) Create a new sequence with the name.QuerySequence(String name, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) QuerySequence(String name, int size) Create a new sequence with the name and sequence pre-allocation size.QuerySequence(String name, int size, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) QuerySequence(String name, int size, int initialValue) QuerySequence(String name, int size, int initialValue, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) -
Method Summary
Modifier and TypeMethodDescriptionprotected ValueReadQueryINTERNAL:protected ValueReadQuerybuildSelectQuery(String seqName, Integer size) INTERNAL:protected DataModifyQueryINTERNAL:protected DataModifyQuerybuildUpdateQuery(String seqName, Number sizeOrNewValue) INTERNAL:createArguments(DatabaseQuery query, String seqName, Number sizeOrNewValue) INTERNAL:booleanPUBLIC:PUBLIC:inthashCode()voidINTERNAL:voidINTERNAL:protected Objectselect(Accessor accessor, AbstractSession writeSession, String seqName, Integer size) INTERNAL:voidsetSelectQuery(ValueReadQuery query) PUBLIC:voidsetShouldAcquireValueAfterInsert(boolean shouldAcquireValueAfterInsert) PUBLIC:voidsetShouldSelectBeforeUpdate(boolean shouldSelectBeforeUpdate) PUBLIC:voidsetShouldSkipUpdate(boolean shouldSkipUpdate) PUBLIC:voidsetShouldUseTransaction(boolean shouldUseTransaction) PUBLIC:voidsetUpdateQuery(DataModifyQuery query) PUBLIC:booleanPUBLIC:booleanPUBLIC:booleanPUBLIC:booleanPUBLIC:protected voidupdate(Accessor accessor, AbstractSession writeSession, String seqName, Number sizeOrNewValue) INTERNAL:protected NumberupdateAndSelectSequence(Accessor accessor, AbstractSession writeSession, String seqName, int size) INTERNAL:Methods 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, isTable, isUnaryTable, onConnect, onDisconnect, setDatasourcePlatform, setName, setPreallocationSize, setQualifier, setShouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldUsePreallocation, toString, verifyPlatform
-
Field Details
-
selectQuery
-
updateQuery
-
shouldAcquireValueAfterInsert
protected boolean shouldAcquireValueAfterInsert -
shouldUseTransaction
protected boolean shouldUseTransaction -
shouldSkipUpdate
protected boolean shouldSkipUpdate -
shouldSelectBeforeUpdate
protected boolean shouldSelectBeforeUpdate -
wasSelectQueryCreated
protected boolean wasSelectQueryCreated -
wasUpdateQueryCreated
protected boolean wasUpdateQueryCreated
-
-
Constructor Details
-
QuerySequence
public QuerySequence() -
QuerySequence
Create a new sequence with the name. -
QuerySequence
Create a new sequence with the name and sequence pre-allocation size. -
QuerySequence
-
QuerySequence
public QuerySequence(boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) -
QuerySequence
public QuerySequence(String name, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) -
QuerySequence
public QuerySequence(String name, int size, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction) -
QuerySequence
public QuerySequence(String name, int size, int initialValue, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
shouldAcquireValueAfterInsert
public boolean shouldAcquireValueAfterInsert()PUBLIC:- Specified by:
shouldAcquireValueAfterInsertin classStandardSequence
-
setShouldAcquireValueAfterInsert
public void setShouldAcquireValueAfterInsert(boolean shouldAcquireValueAfterInsert) PUBLIC: -
shouldUseTransaction
public boolean shouldUseTransaction()PUBLIC:- Specified by:
shouldUseTransactionin classStandardSequence
-
setShouldUseTransaction
public void setShouldUseTransaction(boolean shouldUseTransaction) PUBLIC: -
setSelectQuery
PUBLIC: -
getSelectQuery
PUBLIC: -
setUpdateQuery
PUBLIC: -
getUpdateQuery
PUBLIC: -
setShouldSkipUpdate
public void setShouldSkipUpdate(boolean shouldSkipUpdate) PUBLIC: -
shouldSkipUpdate
public boolean shouldSkipUpdate()PUBLIC: -
setShouldSelectBeforeUpdate
public void setShouldSelectBeforeUpdate(boolean shouldSelectBeforeUpdate) PUBLIC: -
shouldSelectBeforeUpdate
public boolean shouldSelectBeforeUpdate()PUBLIC: -
buildSelectQuery
INTERNAL: -
buildUpdateQuery
INTERNAL: -
buildSelectQuery
INTERNAL: -
buildUpdateQuery
INTERNAL: -
onConnect
public void onConnect()INTERNAL:- Overrides:
onConnectin classStandardSequence
-
onDisconnect
public void onDisconnect()INTERNAL:- Overrides:
onDisconnectin classStandardSequence
-
updateAndSelectSequence
protected Number updateAndSelectSequence(Accessor accessor, AbstractSession writeSession, String seqName, int size) INTERNAL:- Specified by:
updateAndSelectSequencein classStandardSequence
-
select
protected Object select(Accessor accessor, AbstractSession writeSession, String seqName, Integer size) INTERNAL: -
update
protected void update(Accessor accessor, AbstractSession writeSession, String seqName, Number sizeOrNewValue) INTERNAL: -
createArguments
protected Vector<Object> createArguments(DatabaseQuery query, String seqName, Number sizeOrNewValue) INTERNAL:
-