Package io.jmix.data
Interface Sequences
- All Known Implementing Classes:
- SequencesImpl
public interface Sequences
Provides access to the database sequences.
- 
Method SummaryModifier and TypeMethodDescriptionlongcreateNextValue(Sequence sequence) Returns the next sequence value.voiddeleteSequence(Sequence sequence) Removes sequence with specified identifierlonggetCurrentValue(Sequence sequence) Returns the current value of the sequence.voidsetCurrentValue(Sequence sequence, long value) Set current value for the sequence.
- 
Method Details- 
createNextValueReturns the next sequence value. For example:sequences.createNextValue(Sequence.withName("seq_name").setStartValue(10).setIncrement(1))- Parameters:
- sequence- sequence object
- Returns:
- next value
 
- 
getCurrentValueReturns the current value of the sequence. For some implementationscreateNextValue(Sequence)must be called at least once beforehand.- Parameters:
- sequence- object- Sequence
- Returns:
- current value
 
- 
setCurrentValueSet current value for the sequence. NextgetCurrentValue(Sequence)invocation will returnvalueNextcreateNextValue(Sequence)invocation will returnvalue + increment- Parameters:
- sequence- sequence object- Sequence
- value- value
 
- 
deleteSequenceRemoves sequence with specified identifier- Parameters:
- sequence- sequence object- Sequence
- Throws:
- IllegalStateException- if sequence does not exist
 
 
-