Class NativeSequence
- 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
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".
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NativeSequence()
NativeSequence(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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
QuerySequence
getDelegateSequence()
Return the sequence delegate.boolean
hasDelegateSequence()
Return if the sequence should be replaced by another sequence implementation.boolean
isNative()
void
onConnect()
INTERNAL:void
onDisconnect()
INTERNAL:void
setDelegateSequence(QuerySequence delegateSequence)
Set the sequence delegate.void
setShouldUseIdentityIfPlatformSupports(boolean shouldUseIdentityIfPlatformSupports)
boolean
shouldUseIdentityIfPlatformSupports()
-
Methods inherited from class org.eclipse.persistence.sequencing.QuerySequence
getSelectQuery, getUpdateQuery, setSelectQuery, setShouldAcquireValueAfterInsert, setShouldSelectBeforeUpdate, setShouldSkipUpdate, setShouldUseTransaction, setUpdateQuery, shouldAcquireValueAfterInsert, shouldSelectBeforeUpdate, shouldSkipUpdate, shouldUseTransaction
-
Methods inherited from class org.eclipse.persistence.sequencing.StandardSequence
getGeneratedValue, getGeneratedVector, setInitialValue
-
Methods inherited from class org.eclipse.persistence.sequencing.Sequence
clone, equalNameAndSize, getDatasourcePlatform, getGeneratedValue, getGeneratedVector, getInitialValue, getName, getPreallocationSize, getQualified, getQualifier, isConnected, isCustomQualifier, isTable, isUnaryTable, onConnect, onDisconnect, setName, setPreallocationSize, setQualifier, setShouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldAlwaysOverrideExistingValue, shouldUsePreallocation, toString
-
-
-
-
Constructor Detail
-
NativeSequence
public NativeSequence()
-
NativeSequence
public NativeSequence(boolean shouldUseIdentityIfPlatformSupports)
-
NativeSequence
public NativeSequence(String name)
Create a new sequence with the name.
-
NativeSequence
public NativeSequence(String name, boolean shouldUseIdentityIfPlatformSupports)
-
NativeSequence
public NativeSequence(String name, int size)
Create a new sequence with the name and sequence pre-allocation size.
-
NativeSequence
public NativeSequence(String name, int size, boolean shouldUseIdentityIfPlatformSupports)
-
NativeSequence
public NativeSequence(String name, int size, int initialValue)
-
NativeSequence
public NativeSequence(String name, int size, int initialValue, boolean shouldUseIdentityIfPlatformSupports)
-
-
Method Detail
-
setShouldUseIdentityIfPlatformSupports
public void setShouldUseIdentityIfPlatformSupports(boolean shouldUseIdentityIfPlatformSupports)
-
shouldUseIdentityIfPlatformSupports
public boolean shouldUseIdentityIfPlatformSupports()
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classQuerySequence
-
hasDelegateSequence
public 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.
-
getDelegateSequence
public QuerySequence getDelegateSequence()
Return the sequence delegate. This is used when the platform does not support the native sequence type.
-
setDelegateSequence
public void setDelegateSequence(QuerySequence delegateSequence)
Set the sequence delegate. This is used when the platform does not support the native sequence type.
-
onConnect
public void onConnect()
INTERNAL:- Overrides:
onConnect
in classQuerySequence
-
onDisconnect
public void onDisconnect()
INTERNAL:- Overrides:
onDisconnect
in classQuerySequence
-
-