Class QuerySequence
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
Modifier and TypeFieldDescriptionprotected ValueReadQuery
protected boolean
protected boolean
protected boolean
protected boolean
protected DataModifyQuery
protected boolean
protected boolean
Fields inherited from class org.eclipse.persistence.sequencing.Sequence
depth, initialValue, isCustomQualifier, name, platform, qualifier, shouldAlwaysOverrideExistingValue, size
-
Constructor Summary
ConstructorDescriptionQuerySequence
(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 ValueReadQuery
INTERNAL:protected ValueReadQuery
buildSelectQuery
(String seqName, Integer size) INTERNAL:protected DataModifyQuery
INTERNAL:protected DataModifyQuery
buildUpdateQuery
(String seqName, Number sizeOrNewValue) INTERNAL:protected Vector
createArguments
(DatabaseQuery query, String seqName, Number sizeOrNewValue) INTERNAL:boolean
PUBLIC:PUBLIC:int
hashCode()
void
INTERNAL:void
INTERNAL:protected Object
select
(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, Integer size) INTERNAL:void
setSelectQuery
(ValueReadQuery query) PUBLIC:void
setShouldAcquireValueAfterInsert
(boolean shouldAcquireValueAfterInsert) PUBLIC:void
setShouldSelectBeforeUpdate
(boolean shouldSelectBeforeUpdate) PUBLIC:void
setShouldSkipUpdate
(boolean shouldSkipUpdate) PUBLIC:void
setShouldUseTransaction
(boolean shouldUseTransaction) PUBLIC:void
setUpdateQuery
(DataModifyQuery query) PUBLIC:boolean
PUBLIC:boolean
PUBLIC:boolean
PUBLIC:boolean
PUBLIC:protected void
update
(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, Number sizeOrNewValue) INTERNAL:protected Number
updateAndSelectSequence
(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, int size) INTERNAL:Methods inherited from class org.eclipse.persistence.sequencing.StandardSequence
createVector, createVectorAtNextVal, 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, 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:
shouldAcquireValueAfterInsert
in classStandardSequence
-
setShouldAcquireValueAfterInsert
public void setShouldAcquireValueAfterInsert(boolean shouldAcquireValueAfterInsert) PUBLIC: -
shouldUseTransaction
public boolean shouldUseTransaction()PUBLIC:- Specified by:
shouldUseTransaction
in 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:
onConnect
in classStandardSequence
-
onDisconnect
public void onDisconnect()INTERNAL:- Overrides:
onDisconnect
in classStandardSequence
-
updateAndSelectSequence
protected Number updateAndSelectSequence(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, int size) INTERNAL:- Specified by:
updateAndSelectSequence
in classStandardSequence
-
select
protected Object select(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, Integer size) INTERNAL: -
update
protected void update(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, Number sizeOrNewValue) INTERNAL: -
createArguments
INTERNAL:
-