public interface Sequence
Sequence allows to get unique successive non-negative long numbers. Sequences are named,
you can request a sequence by name using methods StoreTransaction.getSequence(String) or
StoreTransaction.getSequence(String, long). Sequences are persistent, any
flushed or committed transaction saves all dirty (mutated) sequences which were
requested by transactions created against current PersistentEntityStore.
PersistentEntityStore implementation uses Sequences to generate EntityId instances.
| Modifier and Type | Method and Description |
|---|---|
long |
get()
Returns current number obtained by last call to increment().
|
long |
increment()
Returns next non-negative number.
|
void |
set(long l)
Sets current number.
|
long increment()
Sequence created by method
StoreTransaction.getSequence(String), it starts with 0.
For a Sequence created by method
StoreTransaction.getSequence(String, long), it starts with specified initial value.long get()
-1.-1void set(long l)
l + 1.l - current number