Package io.jmix.data

Interface Sequences

All Known Implementing Classes:
SequencesImpl

public interface Sequences
Provides access to the database sequences.
  • Method Details

    • createNextValue

      long createNextValue(Sequence sequence)
      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

      long getCurrentValue(Sequence sequence)
      Returns the current value of the sequence. For some implementations createNextValue(Sequence) must be called at least once beforehand.
      Parameters:
      sequence - object Sequence
      Returns:
      current value
    • setCurrentValue

      void setCurrentValue(Sequence sequence, long value)
      Set current value for the sequence. Next getCurrentValue(Sequence) invocation will return value Next createNextValue(Sequence) invocation will return value + increment
      Parameters:
      sequence - sequence object Sequence
      value - value
    • deleteSequence

      void deleteSequence(Sequence sequence)
      Removes sequence with specified identifier
      Parameters:
      sequence - sequence object Sequence
      Throws:
      IllegalStateException - if sequence does not exist