Interface EntityInformation<T,ID>

All Superinterfaces:
EntityMetadata<T>
All Known Implementing Classes:
AbstractEntityInformation, DelegatingEntityInformation, PersistentEntityInformation

public interface EntityInformation<T,ID> extends EntityMetadata<T>
Extension of EntityMetadata to add functionality to query information of entity instances.
Author:
Oliver Gierke, Mark Paluch, Johannes Englmeier
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    getId(T entity)
    Returns the id of the given entity or null if none can be obtained.
    Returns the type of the id of the entity.
    default ID
    getRequiredId(T entity)
    Returns the identifier of the given entity.
    boolean
    isNew(T entity)
    Returns whether the given entity is considered to be new.

    Methods inherited from interface org.springframework.data.repository.core.EntityMetadata

    getJavaType
  • Method Details

    • isNew

      boolean isNew(T entity)
      Returns whether the given entity is considered to be new.
      Parameters:
      entity - must never be null
      Returns:
    • getId

      @Nullable ID getId(T entity)
      Returns the id of the given entity or null if none can be obtained.
      Parameters:
      entity - must never be null
      Returns:
    • getRequiredId

      default ID getRequiredId(T entity) throws IllegalArgumentException
      Returns the identifier of the given entity.
      Parameters:
      entity - must not be null.
      Returns:
      the identifier of the given entity
      Throws:
      IllegalArgumentException - in case no id could be obtained from the given entity
      Since:
      2.0
    • getIdType

      Class<ID> getIdType()
      Returns the type of the id of the entity.
      Returns: