All Known Implementing Classes:
NotSettingIdSetter, SimpleIdSetter

public interface IdSetter<T>
A IdSetter must be unique in one storage for one entity-class. It creates Ids and therefore must know all existing entities of one class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> IdSetter<T>
    createIdSetter(Class<T> classWithId, Consumer<Object> lastIdPersister, Supplier<Object> lastIdGetter)
     
    void
    ensureId(T objectToSetIdIn)
    This method makes sure, that an id is set for the given object.
  • Method Details

    • createIdSetter

      static <T> IdSetter<T> createIdSetter(Class<T> classWithId, Consumer<Object> lastIdPersister, Supplier<Object> lastIdGetter)
    • ensureId

      void ensureId(T objectToSetIdIn)
      This method makes sure, that an id is set for the given object. If it is already set (not null), then nothing is done. If it is not set, a new one will be generated and set.