Interface JpaEntityInformation<T,ID>

All Superinterfaces:
EntityInformation<T,ID>, EntityMetadata<T>, JpaEntityMetadata<T>
All Known Implementing Classes:
JpaEntityInformationSupport, JpaMetamodelEntityInformation, JpaPersistableEntityInformation

public interface JpaEntityInformation<T,ID> extends EntityInformation<T,ID>, JpaEntityMetadata<T>
Extension of EntityInformation to capture additional JPA specific information about entities.
Author:
Oliver Gierke, Thomas Darimont, Mark Paluch
  • Method Details

    • getIdAttribute

      @Nullable jakarta.persistence.metamodel.SingularAttribute<? super T,?> getIdAttribute()
      Returns the id attribute of the entity.
    • getRequiredIdAttribute

      default jakarta.persistence.metamodel.SingularAttribute<? super T,?> getRequiredIdAttribute() throws IllegalArgumentException
      Returns the required identifier type.
      Returns:
      the identifier type.
      Throws:
      IllegalArgumentException - in case no id type could be obtained.
      Since:
      2.0
    • hasCompositeId

      boolean hasCompositeId()
      Returns true if the entity has a composite id.
    • getIdAttributeNames

      Collection<String> getIdAttributeNames()
      Returns the attribute names of the id attributes. If the entity has a composite id, then all id attribute names are returned. If the entity has a single id attribute then this single attribute name is returned.
    • getCompositeIdAttributeValue

      @Nullable Object getCompositeIdAttributeValue(Object id, String idAttribute)
      Extracts the value for the given id attribute from a composite id
      Parameters:
      id - the composite id from which to extract the attribute.
      idAttribute - the attribute name to extract.
    • getKeyset

      Map<String,Object> getKeyset(Iterable<String> propertyPaths, T entity)
      Extract a keyset for propertyPaths and the primary key (including composite key components if applicable).
      Parameters:
      propertyPaths - the property paths that make up the keyset in combination with the composite key components.
      entity - the entity to extract values from
      Returns:
      a map mapping String representations of the paths to values from the entity.
      Since:
      3.1