Interface IdStrategy

All Known Implementing Classes:
InternalIdStrategy, UuidStrategy

public interface IdStrategy
Id generation strategy that allows custom implementations of id generation. For simple use cases, implementing classes should provide a no-argument constructor and OGM will instantiate the strategy. For cases where OGM can't instantiate the strategy (e.g. because it has other dependencies) it must be registered with the SessionFactory.
Since:
3.0
Author:
Frantisek Hartman
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates new id for given entity
  • Method Details

    • generateId

      Object generateId(Object entity)
      Generates new id for given entity
      Parameters:
      entity - saved entity
      Returns:
      identifier of the entity