public class NativeSequence extends QuerySequence
Purpose: Define a database's native sequencing mechanism.
Description Many databases have built in support for sequencing. This can be a SEQUENCE object such as in Oracle, or a auto-incrementing column such as the IDENTITY field in Sybase. For an auto-incrementing column the preallocation size is always 1. For a SEQUENCE object the preallocation size must match the SEQUENCE objects "increment by".
| Modifier and Type | Field and Description |
|---|---|
protected QuerySequence |
delegateSequence
Allow sequencing to be delegated to another sequence if native sequencing is not supported.
|
protected boolean |
shouldUseIdentityIfPlatformSupports
true indicates that identity should be used - if the platform supports identity.
|
selectQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction, updateQuery, wasSelectQueryCreated, wasUpdateQueryCreateddepth, initialValue, isCustomQualifier, name, platform, qualifier, shouldAlwaysOverrideExistingValue, size| Constructor and Description |
|---|
NativeSequence() |
NativeSequence(boolean shouldUseIdentityIfPlatformSupports) |
NativeSequence(java.lang.String name)
Create a new sequence with the name.
|
NativeSequence(java.lang.String name,
boolean shouldUseIdentityIfPlatformSupports) |
NativeSequence(java.lang.String name,
int size)
Create a new sequence with the name and sequence pre-allocation size.
|
NativeSequence(java.lang.String name,
int size,
boolean shouldUseIdentityIfPlatformSupports) |
NativeSequence(java.lang.String name,
int size,
int initialValue) |
NativeSequence(java.lang.String name,
int size,
int initialValue,
boolean shouldUseIdentityIfPlatformSupports) |
| Modifier and Type | Method and Description |
|---|---|
protected ValueReadQuery |
buildSelectQuery()
INTERNAL:
|
protected ValueReadQuery |
buildSelectQuery(java.lang.String seqName,
java.lang.Integer size)
INTERNAL:
|
boolean |
equals(java.lang.Object obj) |
QuerySequence |
getDelegateSequence()
Return the sequence delegate.
|
boolean |
hasDelegateSequence()
Return if the sequence should be replaced by another sequence implementation.
|
int |
hashCode() |
boolean |
isNative() |
void |
onConnect()
INTERNAL:
|
void |
onDisconnect()
INTERNAL:
|
void |
setDelegateSequence(QuerySequence delegateSequence)
Set the sequence delegate.
|
void |
setShouldUseIdentityIfPlatformSupports(boolean shouldUseIdentityIfPlatformSupports) |
boolean |
shouldUseIdentityIfPlatformSupports() |
buildUpdateQuery, buildUpdateQuery, createArguments, getSelectQuery, getUpdateQuery, select, setSelectQuery, setShouldAcquireValueAfterInsert, setShouldSelectBeforeUpdate, setShouldSkipUpdate, setShouldUseTransaction, setUpdateQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction, update, updateAndSelectSequencecreateVector, createVectorAtNextVal, getGeneratedValue, getGeneratedVector, setInitialValueclone, equalNameAndSize, getDatasourcePlatform, getGeneratedValue, getGeneratedVector, getInitialValue, getName, getPreallocationSize, getQualified, getQualifier, isConnected, isCustomQualifier, isTable, isUnaryTable, onConnect, onDisconnect, setDatasourcePlatform, setName, setPreallocationSize, setQualifier, setShouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldUsePreallocation, toString, verifyPlatformprotected boolean shouldUseIdentityIfPlatformSupports
protected QuerySequence delegateSequence
public NativeSequence()
public NativeSequence(boolean shouldUseIdentityIfPlatformSupports)
public NativeSequence(java.lang.String name)
public NativeSequence(java.lang.String name,
boolean shouldUseIdentityIfPlatformSupports)
public NativeSequence(java.lang.String name,
int size)
public NativeSequence(java.lang.String name,
int size,
boolean shouldUseIdentityIfPlatformSupports)
public NativeSequence(java.lang.String name,
int size,
int initialValue)
public NativeSequence(java.lang.String name,
int size,
int initialValue,
boolean shouldUseIdentityIfPlatformSupports)
public void setShouldUseIdentityIfPlatformSupports(boolean shouldUseIdentityIfPlatformSupports)
public boolean shouldUseIdentityIfPlatformSupports()
public boolean equals(java.lang.Object obj)
equals in class QuerySequencepublic int hashCode()
hashCode in class QuerySequenceprotected ValueReadQuery buildSelectQuery()
buildSelectQuery in class QuerySequenceprotected ValueReadQuery buildSelectQuery(java.lang.String seqName, java.lang.Integer size)
buildSelectQuery in class QuerySequencepublic boolean hasDelegateSequence()
public QuerySequence getDelegateSequence()
public void setDelegateSequence(QuerySequence delegateSequence)
public void onConnect()
onConnect in class QuerySequencepublic void onDisconnect()
onDisconnect in class QuerySequence