Interface PrimaryKeyGenerator<ID>

Type Parameters:
ID - the type of the keys generated
All Known Implementing Classes:
IntegerPrimaryKeyGenerator, LongPrimaryKeyGenerator, UUIDPrimaryKeyGenerator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PrimaryKeyGenerator<ID>
A generator of primary keys of a certain type.
Author:
RealLifeDeveloper
  • Method Summary

    Modifier and Type
    Method
    Description
    nextPrimaryKey(ID previousMax)
    Gives the next primary key given the previous maximum primary key value.
  • Method Details

    • nextPrimaryKey

      ID nextPrimaryKey(ID previousMax)
      Gives the next primary key given the previous maximum primary key value.
      Parameters:
      previousMax - the previous maximum primary key value of any saved entity, or null to start from scratch
      Returns:
      the next primary key