Class QuerySequence
- java.lang.Object
-
- org.eclipse.persistence.sequencing.Sequence
-
- org.eclipse.persistence.sequencing.StandardSequence
-
- org.eclipse.persistence.sequencing.QuerySequence
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
EISSequence
,NativeSequence
,TableSequence
,UnaryTableSequence
public class QuerySequence extends StandardSequence
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ValueReadQuery
selectQuery
protected boolean
shouldAcquireValueAfterInsert
protected boolean
shouldSelectBeforeUpdate
protected boolean
shouldSkipUpdate
protected boolean
shouldUseTransaction
protected DataModifyQuery
updateQuery
protected boolean
wasSelectQueryCreated
protected boolean
wasUpdateQueryCreated
-
Fields inherited from class org.eclipse.persistence.sequencing.Sequence
depth, initialValue, isCustomQualifier, name, platform, qualifier, shouldAlwaysOverrideExistingValue, size
-
-
Constructor Summary
Constructors Constructor Description QuerySequence()
QuerySequence(boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
QuerySequence(java.lang.String name)
Create a new sequence with the name.QuerySequence(java.lang.String name, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
QuerySequence(java.lang.String name, int size)
Create a new sequence with the name and sequence pre-allocation size.QuerySequence(java.lang.String name, int size, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
QuerySequence(java.lang.String name, int size, int initialValue)
QuerySequence(java.lang.String name, int size, int initialValue, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ValueReadQuery
buildSelectQuery()
INTERNAL:protected ValueReadQuery
buildSelectQuery(java.lang.String seqName, java.lang.Integer size)
INTERNAL:protected DataModifyQuery
buildUpdateQuery()
INTERNAL:protected DataModifyQuery
buildUpdateQuery(java.lang.String seqName, java.lang.Number sizeOrNewValue)
INTERNAL:protected java.util.Vector
createArguments(DatabaseQuery query, java.lang.String seqName, java.lang.Number sizeOrNewValue)
INTERNAL:boolean
equals(java.lang.Object obj)
ValueReadQuery
getSelectQuery()
PUBLIC:DataModifyQuery
getUpdateQuery()
PUBLIC:int
hashCode()
void
onConnect()
INTERNAL:void
onDisconnect()
INTERNAL:protected java.lang.Object
select(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, java.lang.String seqName, java.lang.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
shouldAcquireValueAfterInsert()
PUBLIC:boolean
shouldSelectBeforeUpdate()
PUBLIC:boolean
shouldSkipUpdate()
PUBLIC:boolean
shouldUseTransaction()
PUBLIC:protected void
update(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, java.lang.String seqName, java.lang.Number sizeOrNewValue)
INTERNAL:protected java.lang.Number
updateAndSelectSequence(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, java.lang.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 Detail
-
selectQuery
protected ValueReadQuery selectQuery
-
updateQuery
protected DataModifyQuery 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 Detail
-
QuerySequence
public QuerySequence()
-
QuerySequence
public QuerySequence(java.lang.String name)
Create a new sequence with the name.
-
QuerySequence
public QuerySequence(java.lang.String name, int size)
Create a new sequence with the name and sequence pre-allocation size.
-
QuerySequence
public QuerySequence(java.lang.String name, int size, int initialValue)
-
QuerySequence
public QuerySequence(boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
-
QuerySequence
public QuerySequence(java.lang.String name, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
-
QuerySequence
public QuerySequence(java.lang.String name, int size, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
-
QuerySequence
public QuerySequence(java.lang.String name, int size, int initialValue, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
-
-
Method Detail
-
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 void setSelectQuery(ValueReadQuery query)
PUBLIC:
-
getSelectQuery
public ValueReadQuery getSelectQuery()
PUBLIC:
-
setUpdateQuery
public void setUpdateQuery(DataModifyQuery query)
PUBLIC:
-
getUpdateQuery
public DataModifyQuery 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
protected ValueReadQuery buildSelectQuery()
INTERNAL:
-
buildUpdateQuery
protected DataModifyQuery buildUpdateQuery()
INTERNAL:
-
buildSelectQuery
protected ValueReadQuery buildSelectQuery(java.lang.String seqName, java.lang.Integer size)
INTERNAL:
-
buildUpdateQuery
protected DataModifyQuery buildUpdateQuery(java.lang.String seqName, java.lang.Number sizeOrNewValue)
INTERNAL:
-
onConnect
public void onConnect()
INTERNAL:- Overrides:
onConnect
in classStandardSequence
-
onDisconnect
public void onDisconnect()
INTERNAL:- Overrides:
onDisconnect
in classStandardSequence
-
updateAndSelectSequence
protected java.lang.Number updateAndSelectSequence(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, java.lang.String seqName, int size)
INTERNAL:- Specified by:
updateAndSelectSequence
in classStandardSequence
-
select
protected java.lang.Object select(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, java.lang.String seqName, java.lang.Integer size)
INTERNAL:
-
update
protected void update(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, java.lang.String seqName, java.lang.Number sizeOrNewValue)
INTERNAL:
-
createArguments
protected java.util.Vector createArguments(DatabaseQuery query, java.lang.String seqName, java.lang.Number sizeOrNewValue)
INTERNAL:
-
-