Interface ProxyIdAccessor

All Known Implementing Classes:
PersistenceProvider

public interface ProxyIdAccessor
Interface for a persistence provider specific accessor of identifiers held in proxies.
Author:
Oliver Gierke, Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Object
    Returns the identifier of the given entity by leniently inspecting it for the identifier value.
    boolean
    Returns whether the ProxyIdAccessor should be used for the given entity.
  • Method Details

    • shouldUseAccessorFor

      boolean shouldUseAccessorFor(Object entity)
      Returns whether the ProxyIdAccessor should be used for the given entity. Will inspect the entity to see whether it is a proxy so that lenient id lookup can be used.
      Parameters:
      entity - must not be null.
      Returns:
    • getIdentifierFrom

      @Nullable Object getIdentifierFrom(Object entity)
      Returns the identifier of the given entity by leniently inspecting it for the identifier value.
      Parameters:
      entity - must not be null.
      Returns:
      can be null.