Sequence

A sequence is created using the statement CREATE SEQUENCE

Methods
Sequence(Schema schema, int id, String name, long startValue, long increment)
Creates a new sequence for an auto-increment column.
Sequence(Schema schema, int id, String name, long startValue, long increment)
Creates a new sequence for an auto-increment column.
Parameters:
schema - the schema
id - the object id
name - the sequence name
startValue - the first value to return
increment - the increment count
Sequence(Schema schema, int id, String name, Long startValue, Long increment, Long cacheSize, Long minValue, Long maxValue, boolean cycle, boolean belongsToTable)
Creates a new sequence.
Sequence(Schema schema, int id, String name, Long startValue, Long increment, Long cacheSize, Long minValue, Long maxValue, boolean cycle, boolean belongsToTable)
Creates a new sequence.
Parameters:
schema - the schema
id - the object id
name - the sequence name
startValue - the first value to return
increment - the increment count
cacheSize - the number of entries to pre-fetch
minValue - the minimum value
maxValue - the maximum value
cycle - whether to jump back to the min value if needed
belongsToTable - whether this sequence belongs to a table (for auto-increment columns)
void checkRename()
void checkRename()
void close()
Flush the current value to disk and close this object.
void close()
Flush the current value to disk and close this object.
void flush(Session session)
Flush the current value, including the margin, to disk.
void flush(Session session)
Flush the current value, including the margin, to disk.
Parameters:
session - the session
void flushWithoutMargin()
Flush the current value to disk.
void flushWithoutMargin()
Flush the current value to disk.
boolean getBelongsToTable()
boolean getBelongsToTable()
long getCacheSize()
long getCacheSize()
String getCreateSQL()
String getCreateSQL()
String getCreateSQLForCopy(Table table, String quotedName)
String getCreateSQLForCopy(Table table, String quotedName)
long getCurrentValue()
long getCurrentValue()
boolean getCycle()
boolean getCycle()
String getDropSQL()
String getDropSQL()
long getIncrement()
long getIncrement()
long getMaxValue()
long getMaxValue()
long getMinValue()
long getMinValue()
long getNext(Session session)
Get the next value for this sequence.
long getNext(Session session)
Get the next value for this sequence.
Parameters:
session - the session
Returns:
the next value
int getType()
int getType()
void modify(Long startValue, Long minValue, Long maxValue, Long increment)
Allows the start value, increment, min value and max value to be updated atomically, including atomic validation.
void modify(Long startValue, Long minValue, Long maxValue, Long increment)
Allows the start value, increment, min value and max value to be updated atomically, including atomic validation. Useful because setting these attributes one after the other could otherwise result in an invalid sequence state (e.g. min value > max value, start value < min value, etc).
Parameters:
startValue - the new start value (null if no change)
minValue - the new min value (null if no change)
maxValue - the new max value (null if no change)
increment - the new increment (null if no change)
void removeChildrenAndResources(Session session)
void removeChildrenAndResources(Session session)
void setBelongsToTable(boolean b)
void setBelongsToTable(boolean b)
void setCacheSize(long cacheSize)
void setCacheSize(long cacheSize)
void setCycle(boolean cycle)
void setCycle(boolean cycle)

Fields
static int DEFAULT_CACHE_SIZE = 32

DEFAULT_CACHE_SIZE = 32

The default cache size for sequences.