- java.lang.Object
-
- org.datanucleus.store.NucleusSequenceImpl
-
- All Implemented Interfaces:
NucleusSequence
public class NucleusSequenceImpl extends Object implements NucleusSequence
Basic generic implementation of a datastore sequence.
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutionContextecexecution context.protected ValueGeneratorgeneratorThe generator for the sequence.protected SequenceMetaDataseqMetaDataName of the sequence.protected StoreManagerstoreManagerStore Manager where we obtain our sequence.
-
Constructor Summary
Constructors Constructor Description NucleusSequenceImpl(ExecutionContext objectMgr, StoreManager storeMgr, SequenceMetaData seqmd)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallocate(int additional)Method to allocate a set of elements.Objectcurrent()Accessor for the current element.longcurrentValue()Accessor for the current element in the sequence as a long.StringgetName()Accessor for the sequence name.Objectnext()Accessor for the next element in the sequence.longnextValue()Accessor for the next element in the sequence as a long.protected voidsetGenerator()Method to set the value generator to use.
-
-
-
Field Detail
-
storeManager
protected final StoreManager storeManager
Store Manager where we obtain our sequence.
-
seqMetaData
protected final SequenceMetaData seqMetaData
Name of the sequence.
-
generator
protected ValueGenerator generator
The generator for the sequence.
-
ec
protected final ExecutionContext ec
execution context.
-
-
Constructor Detail
-
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 Detail
-
setGenerator
protected void setGenerator()
Method to set the value generator to use.
-
getName
public String 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
public Object 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
public Object 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
-
-