Interface JpaEntityInformation<T,ID>
- All Superinterfaces:
EntityInformation<T,
,ID> EntityMetadata<T>
,JpaEntityMetadata<T>
- All Known Implementing Classes:
JpaEntityInformationSupport
,JpaMetamodelEntityInformation
,JpaPersistableEntityInformation
Extension of
EntityInformation
to capture additional JPA specific information about entities.- Author:
- Oliver Gierke, Thomas Darimont, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptiongetCompositeIdAttributeValue
(Object id, String idAttribute) Extracts the value for the given id attribute from a composite idjakarta.persistence.metamodel.SingularAttribute<? super T,
?> Returns the id attribute of the entity.Returns the attribute names of the id attributes.Extract a keyset forpropertyPaths
and the primary key (including composite key components if applicable).default jakarta.persistence.metamodel.SingularAttribute<? super T,
?> Returns the required identifier type.boolean
Returns true if the entity has a composite id.Methods inherited from interface org.springframework.data.repository.core.EntityInformation
getId, getIdType, getRequiredId, isNew
Methods inherited from interface org.springframework.data.repository.core.EntityMetadata
getJavaType
Methods inherited from interface org.springframework.data.jpa.repository.query.JpaEntityMetadata
getEntityName
-
Method Details
-
getIdAttribute
Returns the id attribute of the entity. -
getRequiredIdAttribute
default jakarta.persistence.metamodel.SingularAttribute<? super T,?> getRequiredIdAttribute() throws IllegalArgumentExceptionReturns 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
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
Extract a keyset forpropertyPaths
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
-