java.lang.Object
org.eclipse.persistence.sequencing.Sequence
org.eclipse.persistence.sequencing.StandardSequence
org.eclipse.persistence.sequencing.QuerySequence
org.eclipse.persistence.sequencing.NativeSequence
- All Implemented Interfaces:
- Serializable,- Cloneable
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".
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected QuerySequenceAllow sequencing to be delegated to another sequence if native sequencing is not supported.protected booleantrue indicates that identity is used and generatedKeys should be used - if the platform supports generatedKeys false indicates that identity is used and generatedKeys should not be used - if the platform does not support generatedKeysprotected booleantrue indicates that identity should be used - if the platform supports identity.Fields inherited from class org.eclipse.persistence.sequencing.QuerySequenceselectQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction, updateQuery, wasSelectQueryCreated, wasUpdateQueryCreatedFields inherited from class org.eclipse.persistence.sequencing.Sequencedepth, initialValue, isCustomQualifier, name, platform, qualifier, shouldAlwaysOverrideExistingValue, size
- 
Constructor SummaryConstructorsConstructorDescriptionNativeSequence(boolean shouldUseIdentityIfPlatformSupports) NativeSequence(String name) Create a new sequence with the name.NativeSequence(String name, boolean shouldUseIdentityIfPlatformSupports) NativeSequence(String name, int size) Create a new sequence with the name and sequence pre-allocation size.NativeSequence(String name, int size, boolean shouldUseIdentityIfPlatformSupports) NativeSequence(String name, int size, int initialValue) NativeSequence(String name, int size, int initialValue, boolean shouldUseIdentityIfPlatformSupports) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected ValueReadQueryINTERNAL:protected ValueReadQuerybuildSelectQuery(String seqName, Integer size) INTERNAL:booleanReturn the sequence delegate.booleanReturn if the sequence should be replaced by another sequence implementation.inthashCode()booleanisNative()voidINTERNAL:voidINTERNAL:voidsetDelegateSequence(QuerySequence delegateSequence) Set the sequence delegate.voidsetShouldUseGeneratedKeysIfPlatformSupports(boolean shouldUseGeneratedKeysIfPlatformSupports) voidsetShouldUseIdentityIfPlatformSupports(boolean shouldUseIdentityIfPlatformSupports) booleanbooleanMethods inherited from class org.eclipse.persistence.sequencing.QuerySequencebuildUpdateQuery, buildUpdateQuery, createArguments, getSelectQuery, getUpdateQuery, select, setSelectQuery, setShouldAcquireValueAfterInsert, setShouldSelectBeforeUpdate, setShouldSkipUpdate, setShouldUseTransaction, setUpdateQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction, update, updateAndSelectSequenceMethods inherited from class org.eclipse.persistence.sequencing.StandardSequencecreateVector, createVectorAtNextVal, getGeneratedValue, getGeneratedVector, setInitialValueMethods inherited from class org.eclipse.persistence.sequencing.Sequenceclone, equalNameAndSize, getDatasourcePlatform, getGeneratedValue, getGeneratedVector, getInitialValue, getName, getPreallocationSize, getQualified, getQualifier, isConnected, isCustomQualifier, isTable, isUnaryTable, onConnect, onDisconnect, setDatasourcePlatform, setName, setPreallocationSize, setQualifier, setShouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldUsePreallocation, toString, verifyPlatform
- 
Field Details- 
shouldUseIdentityIfPlatformSupportsprotected boolean shouldUseIdentityIfPlatformSupportstrue indicates that identity should be used - if the platform supports identity. false indicates that sequence objects should be used - if the platform supports sequence objects.
- 
shouldUseGeneratedKeysIfPlatformSupportsprotected boolean shouldUseGeneratedKeysIfPlatformSupportstrue indicates that identity is used and generatedKeys should be used - if the platform supports generatedKeys false indicates that identity is used and generatedKeys should not be used - if the platform does not support generatedKeys
- 
delegateSequenceAllow sequencing to be delegated to another sequence if native sequencing is not supported.
 
- 
- 
Constructor Details- 
NativeSequencepublic NativeSequence()
- 
NativeSequencepublic NativeSequence(boolean shouldUseIdentityIfPlatformSupports) 
- 
NativeSequenceCreate a new sequence with the name.
- 
NativeSequence
- 
NativeSequenceCreate a new sequence with the name and sequence pre-allocation size.
- 
NativeSequence
- 
NativeSequence
- 
NativeSequencepublic NativeSequence(String name, int size, int initialValue, boolean shouldUseIdentityIfPlatformSupports) 
 
- 
- 
Method Details- 
isNativepublic boolean isNative()
- 
setShouldUseIdentityIfPlatformSupportspublic void setShouldUseIdentityIfPlatformSupports(boolean shouldUseIdentityIfPlatformSupports) 
- 
shouldUseIdentityIfPlatformSupportspublic boolean shouldUseIdentityIfPlatformSupports()
- 
setShouldUseGeneratedKeysIfPlatformSupportspublic void setShouldUseGeneratedKeysIfPlatformSupports(boolean shouldUseGeneratedKeysIfPlatformSupports) 
- 
shouldUseGeneratedKeysIfPlatformSupportspublic boolean shouldUseGeneratedKeysIfPlatformSupports()
- 
equals- Overrides:
- equalsin class- QuerySequence
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- QuerySequence
 
- 
buildSelectQueryINTERNAL:- Overrides:
- buildSelectQueryin class- QuerySequence
 
- 
buildSelectQueryINTERNAL:- Overrides:
- buildSelectQueryin class- QuerySequence
 
- 
hasDelegateSequencepublic boolean hasDelegateSequence()Return if the sequence should be replaced by another sequence implementation. This is used when the platform does not support the native sequence type.
- 
getDelegateSequenceReturn the sequence delegate. This is used when the platform does not support the native sequence type.
- 
setDelegateSequenceSet the sequence delegate. This is used when the platform does not support the native sequence type.
- 
onConnectpublic void onConnect()INTERNAL:- Overrides:
- onConnectin class- QuerySequence
 
- 
onDisconnectpublic void onDisconnect()INTERNAL:- Overrides:
- onDisconnectin class- QuerySequence
 
 
-