Class SequenceOptions
java.lang.Object
org.h2.command.ddl.SequenceOptions
Sequence options.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long[]private Expressionprivate Sequence.Cycleprivate TypeInfoprivate Expressionprivate Expressionprivate Expressionprivate final Sequenceprivate Expressionprivate Expression -
Constructor Summary
ConstructorsConstructorDescriptionCreates new instance of sequence options.SequenceOptions(Sequence oldSequence, TypeInfo dataType) Creates new instance of sequence options. -
Method Summary
Modifier and TypeMethodDescriptionprivate Longprivate voidlong[]static long[]Get the bounds (min, max) of a data type.getCacheSize(SessionLocal session) Gets cache size.private longgetCurrentStart(Sequence sequence, SessionLocal session) getCycle()Gets cycle option.getIncrement(SessionLocal session) Gets increment value.private static LonggetLong(SessionLocal session, Expression expr) getMaxValue(Sequence sequence, SessionLocal session) Gets max value.getMinValue(Sequence sequence, SessionLocal session) Gets min value.getRestartValue(SessionLocal session, long startValue) Gets restart value.getStartValue(SessionLocal session) Gets start value.voidsetCacheSize(Expression cacheSize) Sets cache size.voidsetCycle(Sequence.Cycle cycle) Sets cycle option.voidsetDataType(TypeInfo dataType) voidsetIncrement(Expression increment) Sets increment value expression.voidsetMaxValue(Expression maxValue) Sets max value expression.voidsetMinValue(Expression minValue) Sets min value expression.voidsetRestartValue(Expression restart) Sets restart value expression, orValueExpression.DEFAULT.voidsetStartValue(Expression start) Sets start value expression.
-
Field Details
-
dataType
-
start
-
restart
-
increment
-
maxValue
-
minValue
-
cycle
-
cacheSize
-
bounds
private long[] bounds -
oldSequence
-
-
Constructor Details
-
SequenceOptions
public SequenceOptions()Creates new instance of sequence options. -
SequenceOptions
-
-
Method Details
-
getLong
-
getDataType
-
copyFromOldSequence
private void copyFromOldSequence() -
setDataType
-
getStartValue
Gets start value.- Parameters:
session- The session to calculate the value.- Returns:
- start value or
nullif value is not defined.
-
setStartValue
Sets start value expression.- Parameters:
start- START WITH value expression.
-
getRestartValue
Gets restart value.- Parameters:
session- the session to calculate the valuestartValue- the start value to use if restart without value is specified- Returns:
- restart value or
nullif value is not defined.
-
setRestartValue
Sets restart value expression, orValueExpression.DEFAULT.- Parameters:
restart- RESTART WITH value expression, orValueExpression.DEFAULTfor simple RESTART
-
getIncrement
Gets increment value.- Parameters:
session- The session to calculate the value.- Returns:
- increment value or
nullif value is not defined.
-
setIncrement
Sets increment value expression.- Parameters:
increment- INCREMENT BY value expression.
-
getMaxValue
Gets max value.- Parameters:
sequence- the sequence to get default max value.session- The session to calculate the value.- Returns:
- max value when the MAXVALUE expression is set, otherwise returns default max value.
-
setMaxValue
Sets max value expression.- Parameters:
maxValue- MAXVALUE expression.
-
getMinValue
Gets min value.- Parameters:
sequence- the sequence to get default min value.session- The session to calculate the value.- Returns:
- min value when the MINVALUE expression is set, otherwise returns default min value.
-
setMinValue
Sets min value expression.- Parameters:
minValue- MINVALUE expression.
-
check
-
getBounds
public long[] getBounds() -
getBounds
Get the bounds (min, max) of a data type.- Parameters:
dataType- the data type- Returns:
- the bounds (an array with 2 elements)
-
getCycle
Gets cycle option.- Returns:
- cycle option value or
nullif is not defined.
-
setCycle
-
getCacheSize
Gets cache size.- Parameters:
session- The session to calculate the value.- Returns:
- cache size or
nullif value is not defined.
-
setCacheSize
-
getCurrentStart
-