Package org.h2.command.ddl
Class SequenceOptions
java.lang.Object
org.h2.command.ddl.SequenceOptions
Sequence options.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates new instance of sequence options.SequenceOptions(Sequence oldSequence, TypeInfo dataType) Creates new instance of sequence options. -
Method Summary
Modifier and TypeMethodDescriptionlong[]static long[]Get the bounds (min, max) of a data type.getCacheSize(SessionLocal session) Gets cache size.getCycle()Gets cycle option.getIncrement(SessionLocal session) Gets increment value.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.
-
Constructor Details
-
SequenceOptions
public SequenceOptions()Creates new instance of sequence options. -
SequenceOptions
Creates new instance of sequence options.- Parameters:
oldSequence- the sequence to copy options fromdataType- the new data type
-
-
Method Details
-
getDataType
-
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.
-
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
Sets cycle option.- Parameters:
cycle- option value.
-
getCacheSize
Gets cache size.- Parameters:
session- The session to calculate the value.- Returns:
- cache size or
nullif value is not defined.
-
setCacheSize
Sets cache size.- Parameters:
cacheSize- cache size.
-