Package io.jmix.data
Interface Sequences
- All Known Implementing Classes:
SequencesImpl
public interface Sequences
Provides access to the database sequences.
-
Method Summary
Modifier and TypeMethodDescriptionlongcreateNextValue(Sequence sequence) Returns the next sequence value.voiddeleteSequence(Sequence sequence) Removes sequence with specified identifierlonggetCurrentValue(Sequence sequence) Deprecated, for removal: This API element is subject to removal in a future version.as unused Returns the current value of the sequence.voidsetCurrentValue(Sequence sequence, long value) Set current value for the sequence.
-
Method Details
-
createNextValue
Returns the next sequence value. For example:sequences.createNextValue(Sequence.withName("seq_name").setStartValue(10).setIncrement(1))- Parameters:
sequence- sequence object- Returns:
- next value
-
getCurrentValue
Deprecated, for removal: This API element is subject to removal in a future version.as unused Returns the current value of the sequence. For some implementationscreateNextValue(Sequence)must be called at least once beforehand.- Parameters:
sequence- objectSequence- Returns:
- current value
-
setCurrentValue
Set current value for the sequence. NextgetCurrentValue(Sequence)invocation will returnvalueNextcreateNextValue(Sequence)invocation will returnvalue + increment- Parameters:
sequence- sequence objectSequencevalue- value
-
deleteSequence
Removes sequence with specified identifier- Parameters:
sequence- sequence objectSequence- Throws:
IllegalStateException- if sequence does not exist
-