Class AbstractEntityInformation<T,ID>

java.lang.Object
org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
All Implemented Interfaces:
EntityInformation<T,ID>, EntityMetadata<T>

public abstract class AbstractEntityInformation<T,ID> extends Object implements EntityInformation<T,ID>
Base class for implementations of EntityInformation. Considers an entity to be new whenever EntityInformation.getId(Object) returns null or the identifier is a Java primitive and EntityInformation.getId(Object) returns zero.
Author:
Oliver Gierke, Nick Williams, Mark Paluch, Johannes Englmeier
  • Constructor Details

    • AbstractEntityInformation

      public AbstractEntityInformation(Class<T> domainClass)
  • Method Details

    • isNew

      public boolean isNew(T entity)
      Description copied from interface: EntityInformation
      Returns whether the given entity is considered to be new.
      Specified by:
      isNew in interface EntityInformation<T,ID>
      Parameters:
      entity - must never be null
      Returns:
    • getJavaType

      public Class<T> getJavaType()
      Description copied from interface: EntityMetadata
      Returns the actual domain class type.
      Specified by:
      getJavaType in interface EntityMetadata<T>
      Returns: