Package org.datanucleus.api.jdo
Class JDOSequence
java.lang.Object
org.datanucleus.api.jdo.JDOSequence
- All Implemented Interfaces:
javax.jdo.datastore.Sequence,org.datanucleus.store.NucleusSequence
public class JDOSequence
extends Object
implements javax.jdo.datastore.Sequence, org.datanucleus.store.NucleusSequence
Basic generic implementation of a JDO2 datastore sequence.
Wraps a NucleusSequence.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.datanucleus.store.NucleusSequenceUnderlying NucleusSequence. -
Constructor Summary
Constructors -
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.
-
Field Details
-
sequence
protected org.datanucleus.store.NucleusSequence sequenceUnderlying NucleusSequence.
-
-
Constructor Details
-
JDOSequence
public JDOSequence(org.datanucleus.store.NucleusSequence seq) Constructor.- Parameters:
seq- Underlying sequence
-
-
Method Details
-
getName
Accessor for the sequence name.- Specified by:
getNamein interfaceorg.datanucleus.store.NucleusSequence- Specified by:
getNamein interfacejavax.jdo.datastore.Sequence- Returns:
- The sequence name
-
allocate
public void allocate(int additional) Method to allocate a set of elements.- Specified by:
allocatein interfaceorg.datanucleus.store.NucleusSequence- Specified by:
allocatein interfacejavax.jdo.datastore.Sequence- Parameters:
additional- The number of additional elements to allocate
-
next
Accessor for the next element in the sequence.- Specified by:
nextin interfaceorg.datanucleus.store.NucleusSequence- Specified by:
nextin interfacejavax.jdo.datastore.Sequence- Returns:
- The next element
-
nextValue
public long nextValue()Accessor for the next element in the sequence as a long.- Specified by:
nextValuein interfaceorg.datanucleus.store.NucleusSequence- Specified by:
nextValuein interfacejavax.jdo.datastore.Sequence- Returns:
- The next element
- Throws:
javax.jdo.JDODataStoreException- Thrown if not numeric
-
current
Accessor for the current element.- Specified by:
currentin interfaceorg.datanucleus.store.NucleusSequence- Specified by:
currentin interfacejavax.jdo.datastore.Sequence- Returns:
- The current element.
-
currentValue
public long currentValue()Accessor for the current element in the sequence as a long.- Specified by:
currentValuein interfaceorg.datanucleus.store.NucleusSequence- Specified by:
currentValuein interfacejavax.jdo.datastore.Sequence- Returns:
- The current element
- Throws:
javax.jdo.JDODataStoreException- Thrown if not numeric
-