Package org.datanucleus.store
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 ExecutionContext
execution context.protected ValueGenerator
The generator for the sequence.protected final SequenceMetaData
Name of the sequence.protected final StoreManager
Store Manager where we obtain our sequence. -
Constructor Summary
ConstructorsConstructorDescriptionNucleusSequenceImpl
(ExecutionContext objectMgr, StoreManager storeMgr, SequenceMetaData seqmd) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
allocate
(int additional) Method to allocate a set of elements.current()
Accessor for the current element.long
Accessor 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.long
Accessor for the next element in the sequence as a long.protected void
Method 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:
getName
in interfaceNucleusSequence
- Returns:
- The sequence name
-
allocate
public void allocate(int additional) Method to allocate a set of elements.- Specified by:
allocate
in interfaceNucleusSequence
- Parameters:
additional
- The number of additional elements to allocate
-
next
Accessor for the next element in the sequence.- Specified by:
next
in interfaceNucleusSequence
- Returns:
- The next element
-
nextValue
public long nextValue()Accessor for the next element in the sequence as a long.- Specified by:
nextValue
in interfaceNucleusSequence
- Returns:
- The next element
-
current
Accessor for the current element.- Specified by:
current
in interfaceNucleusSequence
- Returns:
- The current element.
-
currentValue
public long currentValue()Accessor for the current element in the sequence as a long.- Specified by:
currentValue
in interfaceNucleusSequence
- Returns:
- The current element
-