| Modifier and Type | Class and Description |
|---|---|
| public static enum | Sequence.
CYCLE clause and sequence state. |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private boolean | |
| private long | |
| private Sequence. | |
| private TypeInfo | |
| public static final int | DEFAULT_CACHE_SIZE
The default cache size for sequences. |
| private long | |
| private long | |
| private long | |
| private long | |
| private long | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | Sequence(SessionLocal
the session session, Schema the schema schema, int the object id id, String the sequence name name, SequenceOptions the sequence options options, boolean whether this sequence belongs to a table (for generated
columns) belongsToTable)Creates a new sequence. |
| Modifier and Type | Method and Description |
|---|---|
| private long | Returns: the prospective or adjusted cache sizethe prospective base value baseValue, long the prospective start value startValue, long the prospective min value minValue, long the prospective max value maxValue, long the prospective increment increment, long the prospective cache size cacheSize, boolean whether cache size may be adjusted, cache size 0 is adjusted
unconditionally to 1 mayAdjustCacheSize)Validates the specified prospective base value, start value, min value, max value, increment, and cache size relative to each other, since each of their respective validities are contingent on the values of the other parameters. |
| public void | |
| private boolean | |
| public void | |
| private void | |
| public void | |
| public synchronized long | |
| public boolean | |
| public long | |
| public String | |
| public synchronized long | |
| public Sequence. | |
| public TypeInfo | |
| public static long | Returns: min value.the start value of the sequence. startValue, long the increment of the sequence value. increment, long[] min and max bounds of data type of the sequence bounds)Calculates default max value. |
| public static long | Returns: min value.the start value of the sequence. startValue, long the increment of the sequence value. increment, long[] min and max bounds of data type of the sequence bounds)Calculates default min value. |
| public String | |
| public int | |
| public long | |
| private static long | |
| public long | |
| public long | |
| public Value | Returns: the next valuethe session session)Get the next value for this sequence. |
| public synchronized StringBuilder | Returns: the builderthe builder builder)Append the options part of the SQL statement to create the sequence. |
| private StringBuilder | |
| public long | |
| public int | |
| private boolean | |
| public synchronized void | modify(Long
the base value ( baseValue, Long null if restart is not requested)the new start value ( startValue, Long null if no change)the new min value ( minValue, Long null if no change)the new max value ( maxValue, Long null if no change)the new increment ( increment, Sequence.null if no change)the new cycle value, or cycle,null if no changethe new cache size ( cacheSize)null if no change)Allows the base value, start value, min value, max value, increment and cache size to be updated atomically, including atomic validation. |
| public void | removeChildrenAndResources(SessionLocal
the session session)Implements abstract org. Delete all dependent children objects and resources of this object. |
| public void |
| baseValue | back to summary |
|---|---|
| private long baseValue | |
| belongsToTable | back to summary |
|---|---|
| private boolean belongsToTable | |
| cacheSize | back to summary |
|---|---|
| private long cacheSize | |
| cycle | back to summary |
|---|---|
| private Sequence. | |
| dataType | back to summary |
|---|---|
| private TypeInfo dataType | |
| DEFAULT_CACHE_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_CACHE_SIZE The default cache size for sequences. | |
| increment | back to summary |
|---|---|
| private long increment | |
| margin | back to summary |
|---|---|
| private long margin | |
| maxValue | back to summary |
|---|---|
| private long maxValue | |
| minValue | back to summary |
|---|---|
| private long minValue | |
| startValue | back to summary |
|---|---|
| private long startValue | |
| writeWithMargin | back to summary |
|---|---|
| private boolean writeWithMargin | |
| Sequence | back to summary |
|---|---|
| public Sequence(SessionLocal session, Schema schema, int id, String name, SequenceOptions options, boolean belongsToTable) Creates a new sequence.
| |
| checkOptions | back to summary |
|---|---|
| private long checkOptions(long baseValue, long startValue, long minValue, long maxValue, long increment, long cacheSize, boolean mayAdjustCacheSize) Validates the specified prospective base value, start value, min value, max value, increment, and cache size relative to each other, since each of their respective validities are contingent on the values of the other parameters.
| |
| close | back to summary |
|---|---|
| public void close() Flush the current value to disk and close this object. | |
| decrement | back to summary |
|---|---|
| private boolean decrement(long oldBase, long newBase) | |
| flush | back to summary |
|---|---|
| public void flush(SessionLocal session) Flush the current value, including the margin, to disk.
| |
| flushInternal | back to summary |
|---|---|
| private void flushInternal(SessionLocal session) | |
| flushWithoutMargin | back to summary |
|---|---|
| public void flushWithoutMargin() Flush the current value to disk. | |
| getBaseValue | back to summary |
|---|---|
| public synchronized long getBaseValue() | |
| getBelongsToTable | back to summary |
|---|---|
| public boolean getBelongsToTable() | |
| getCacheSize | back to summary |
|---|---|
| public long getCacheSize() | |
| getCreateSQL | back to summary |
|---|---|
| public String getCreateSQL() Implements abstract org. Doc from org. Construct the CREATE ... SQL statement for this object. | |
| getCurrentValue | back to summary |
|---|---|
| public synchronized long getCurrentValue() | |
| getCycle | back to summary |
|---|---|
| public Sequence. | |
| getDataType | back to summary |
|---|---|
| public TypeInfo getDataType() | |
| getDefaultMaxValue | back to summary |
|---|---|
| public static long getDefaultMaxValue(Long startValue, long increment, long[] bounds) Calculates default max value.
| |
| getDefaultMinValue | back to summary |
|---|---|
| public static long getDefaultMinValue(Long startValue, long increment, long[] bounds) Calculates default min value.
| |
| getDropSQL | back to summary |
|---|---|
| public String getDropSQL() Overrides org. Doc from org. Construct a DROP ... SQL statement for this object. | |
| getEffectivePrecision | back to summary |
|---|---|
| public int getEffectivePrecision() | |
| getIncrement | back to summary |
|---|---|
| public long getIncrement() | |
| getMaxCacheSize | back to summary |
|---|---|
| private static long getMaxCacheSize(long range, long increment) | |
| getMaxValue | back to summary |
|---|---|
| public long getMaxValue() | |
| getMinValue | back to summary |
|---|---|
| public long getMinValue() | |
| getNext | back to summary |
|---|---|
| public Value getNext(SessionLocal session) Get the next value for this sequence. Should not be called directly, use
| |
| getSequenceOptionsSQL | back to summary |
|---|---|
| public synchronized StringBuilder getSequenceOptionsSQL(StringBuilder builder) Append the options part of the SQL statement to create the sequence.
| |
| getSequenceOptionsSQL | back to summary |
|---|---|
| private StringBuilder getSequenceOptionsSQL(StringBuilder builder, long value) | |
| getStartValue | back to summary |
|---|---|
| public long getStartValue() | |
| getType | back to summary |
|---|---|
| public int getType() Implements abstract org. Doc from org. Get the object type.
| |
| increment | back to summary |
|---|---|
| private boolean increment(long oldBase, long newBase) | |
| modify | back to summary |
|---|---|
| public synchronized void modify(Long baseValue, Long startValue, Long minValue, Long maxValue, Long increment, Sequence. Allows the base value, start value, min value, max value, increment and cache size 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).
| |
| removeChildrenAndResources | back to summary |
|---|---|
| public void removeChildrenAndResources(SessionLocal session) Implements abstract org. Doc from org. Delete all dependent children objects and resources of this object.
| |
| setBelongsToTable | back to summary |
|---|---|
| public void setBelongsToTable(boolean b) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Sequence. | CYCLE
Sequence is cycled. |
| public static final Sequence. | EXHAUSTED
Sequence is not cycled and was already exhausted. |
| public static final Sequence. | NO_CYCLE
Sequence is not cycled and isn't exhausted yet. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if sequence is cycled, false if sequence
is not cycledReturn whether sequence is cycled. |
| public static Sequence. | |
| public static Sequence. |
| CYCLE | back to summary |
|---|---|
| public static final Sequence. Sequence is cycled. | |
| EXHAUSTED | back to summary |
|---|---|
| public static final Sequence. Sequence is not cycled and was already exhausted. | |
| NO_CYCLE | back to summary |
|---|---|
| public static final Sequence. Sequence is not cycled and isn't exhausted yet. | |
| Cycle | back to summary |
|---|---|
| private Cycle() | |
| isCycle | back to summary |
|---|---|
| public boolean isCycle() Return whether sequence is cycled.
| |
| valueOf | back to summary |
|---|---|
| public static Sequence. | |
| values | back to summary |
|---|---|
| public static Sequence. | |