Skip navigation links
oracle.toplink.sequencing
Class StandardSequence
java.lang.Object
oracle.toplink.sequencing.Sequence
oracle.toplink.sequencing.StandardSequence
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- QuerySequence
- public abstract class StandardSequence
- extends Sequence
Purpose: An abstract class providing default sequence behavior.
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
getGeneratedValue(Accessor accessor, Session writeSession, java.lang.String seqName)
INTERNAL: Return the newly-generated sequencing value. |
java.util.Vector |
getGeneratedVector(Accessor accessor, Session writeSession, java.lang.String seqName, int size)
INTERNAL: Return a Vector of newly-generated sequencing values. |
void |
onConnect()
|
void |
onDisconnect()
|
abstract boolean |
shouldAcquireValueAfterInsert()
INTERNAL: Indicates whether sequencing value should be acquired after INSERT. |
abstract boolean |
shouldUseTransaction()
INTERNAL: Indicates whether TopLink should internally call beginTransaction() before getGeneratedValue/Vector, and commitTransaction after. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StandardSequence
public StandardSequence()
StandardSequence
public StandardSequence(java.lang.String name)
StandardSequence
public StandardSequence(java.lang.String name,
int size)
onConnect
public void onConnect()
onDisconnect
public void onDisconnect()
shouldAcquireValueAfterInsert
public abstract boolean shouldAcquireValueAfterInsert()
- Description copied from class:
Sequence
- INTERNAL: Indicates whether sequencing value should be acquired after INSERT. Note that preallocation could be used only in case sequencing values should be acquired before insert (this method returns false). In default implementation, it is true for table sequencing and native sequencing on Oracle platform, false for native sequencing on other platforms.
-
- Specified by:
shouldAcquireValueAfterInsert
in class Sequence
shouldUseTransaction
public abstract boolean shouldUseTransaction()
- Description copied from class:
Sequence
- INTERNAL: Indicates whether TopLink should internally call beginTransaction() before getGeneratedValue/Vector, and commitTransaction after. In default implementation, it is true for table sequencing and false for native sequencing.
-
- Specified by:
shouldUseTransaction
in class Sequence
getGeneratedValue
public java.lang.Object getGeneratedValue(Accessor accessor,
Session writeSession,
java.lang.String seqName)
- Description copied from class:
Sequence
- INTERNAL: Return the newly-generated sequencing value. Used only in case preallocation is not used (shouldUsePreallocation()==false). Accessor may be non-null only in case shouldUseSeparateConnection()==true. Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; Therefore in case shouldUseSeparateConnection()==true, implementation should handle both cases: use a separate connection if provided (accessor != null), or get by without it (accessor == null).
-
- Specified by:
getGeneratedValue
in class Sequence
-
- Parameters:
accessor
- Accessor is a separate sequencing accessor (may be null);
writeSession
- Session is a Session used for writing (either ClientSession or DatabaseSession);
seqName
- String is sequencing number field name
getGeneratedVector
public java.util.Vector getGeneratedVector(Accessor accessor,
Session writeSession,
java.lang.String seqName,
int size)
- Description copied from class:
Sequence
- INTERNAL: Return a Vector of newly-generated sequencing values. Used only in case preallocation is used (shouldUsePreallocation()==true). Accessor may be non-null only in case shouldUseSeparateConnection()==true. Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; Therefore in case shouldUseSeparateConnection()==true, implementation should handle both cases: use a separate connection if provided (accessor != null), or get by without it (accessor == null).
-
- Specified by:
getGeneratedVector
in class Sequence
-
- Parameters:
accessor
- Accessor is a separate sequencing accessor (may be null);
writeSession
- Session is a Session used for writing (either ClientSession or DatabaseSession);
seqName
- String is sequencing number field name
size
- int number of values to preallocate (output Vector size).
Skip navigation links