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 TypeMethodDescription@Nullable ObjectgetCompositeIdAttributeValue(Object id, String idAttribute) Extracts the value for the given id attribute from a composite id@Nullable jakarta.persistence.metamodel.SingularAttribute<? super T, ?> Returns the id attribute of the entity.Returns the attribute names of the id attributes.Extract a keyset forpropertyPathsand the primary key (including composite key components if applicable).default jakarta.persistence.metamodel.SingularAttribute<? super T, ?> Returns the required identifier type.booleanReturns true if the entity has a composite id.Methods inherited from interface EntityInformation
getId, getIdType, getRequiredId, isNewMethods inherited from interface EntityMetadata
getJavaTypeMethods inherited from interface JpaEntityMetadata
getEntityName
-
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 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
-
getKeyset
Extract a keyset forpropertyPathsand 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
-