Class NucleusSequenceImpl
java.lang.Object
org.datanucleus.store.NucleusSequenceImpl
- All Implemented Interfaces:
NucleusSequence
Basic generic implementation of a datastore sequence.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExecutionContextexecution context.protected ValueGeneratorThe generator for the sequence.protected final SequenceMetaDataName of the sequence.protected final StoreManagerStore Manager where we obtain our sequence. -
Constructor Summary
ConstructorsConstructorDescriptionNucleusSequenceImpl(ExecutionContext objectMgr, StoreManager storeMgr, SequenceMetaData seqmd) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidallocate(int additional) Method to allocate a set of elements.current()Accessor for the current element.longAccessor for the current element in the sequence as a long.getName()Accessor for the sequence name.next()Accessor for the next element in the sequence.longAccessor for the next element in the sequence as a long.protected voidMethod to set the value generator to use.
-
Field Details
-
storeManager
Store Manager where we obtain our sequence. -
seqMetaData
Name of the sequence. -
generator
The generator for the sequence. -
ec
execution context.
-
-
Constructor Details
-
NucleusSequenceImpl
public NucleusSequenceImpl(ExecutionContext objectMgr, StoreManager storeMgr, SequenceMetaData seqmd) Constructor.- Parameters:
objectMgr- The ExecutionContext managing the sequencestoreMgr- Manager of the store where we obtain the sequenceseqmd- MetaData defining the sequence
-
-
Method Details
-
setGenerator
protected void setGenerator()Method to set the value generator to use. -
getName
Accessor for the sequence name.- Specified by:
getNamein interfaceNucleusSequence- Returns:
- The sequence name
-
allocate
public void allocate(int additional) Method to allocate a set of elements.- Specified by:
allocatein interfaceNucleusSequence- Parameters:
additional- The number of additional elements to allocate
-
next
Accessor for the next element in the sequence.- Specified by:
nextin interfaceNucleusSequence- Returns:
- The next element
-
nextValue
public long nextValue()Accessor for the next element in the sequence as a long.- Specified by:
nextValuein interfaceNucleusSequence- Returns:
- The next element
-
current
Accessor for the current element.- Specified by:
currentin interfaceNucleusSequence- Returns:
- The current element.
-
currentValue
public long currentValue()Accessor for the current element in the sequence as a long.- Specified by:
currentValuein interfaceNucleusSequence- Returns:
- The current element
-