Interface IdGenerator<T>

Type Parameters:
T - Type of the id to generate
All Known Implementing Classes:
GeneratedValue.InternalIdGenerator, GeneratedValue.UUIDGenerator, UUIDStringGenerator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @API(status=STABLE, since="6.0") public interface IdGenerator<T>
Interface for generating ids for entities.
Since:
6.0
Author:
Michael J. Simons
  • Method Summary

    Modifier and Type
    Method
    Description
    generateId(String primaryLabel, Object entity)
    Generates a new id for given entity.
  • Method Details

    • generateId

      T generateId(String primaryLabel, Object entity)
      Generates a new id for given entity.
      Parameters:
      entity - the entity to be saved
      Returns:
      id to be assigned to the entity