public final class SequenceValueGenerator extends java.lang.Object implements ValueGenerator<java.lang.Long>
ValueGenerator
which generates a sequence of long values. By default, the sequence starts at 1 and
increments by 1, but this can be customized. Instances of this class are created using
ValueGenerators.sequence()
.Modifier and Type | Method and Description |
---|---|
SequenceValueGenerator |
incrementingBy(int increment)
Increments the value by the given increment.
|
java.lang.Long |
nextValue()
Called each time a new row is inserted, to get the value to insert in the column using this value generator.
|
SequenceValueGenerator |
startingAt(long start)
Restarts the sequence at the given value
|
java.lang.String |
toString() |
public SequenceValueGenerator startingAt(long start)
start
- the starting value of the created generatorpublic SequenceValueGenerator incrementingBy(int increment)
public java.lang.Long nextValue()
ValueGenerator
nextValue
in interface ValueGenerator<java.lang.Long>
public java.lang.String toString()
toString
in class java.lang.Object