Class JpaMetamodelEntityInformation<T,ID>
java.lang.Object
org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
org.springframework.data.jpa.repository.support.JpaEntityInformationSupport<T,ID>
org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation<T,ID>
- All Implemented Interfaces:
JpaEntityMetadata<T>,JpaEntityInformation<T,,ID> EntityInformation<T,,ID> EntityMetadata<T>
- Direct Known Subclasses:
JpaPersistableEntityInformation
Implementation of
EntityInformation that uses JPA Metamodel
to find the domain class' id field.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Mark Paluch, Jens Schauder, Greg Turnquist
-
Constructor Summary
ConstructorsConstructorDescriptionJpaMetamodelEntityInformation(Class<T> domainClass, jakarta.persistence.metamodel.Metamodel metamodel, jakarta.persistence.PersistenceUnitUtil persistenceUnitUtil) Creates a newJpaMetamodelEntityInformationfor the given domain class andMetamodel. -
Method Summary
Modifier and TypeMethodDescriptiongetCompositeIdAttributeValue(Object id, String idAttribute) Extracts the value for the given id attribute from a composite idReturns the name of the entity.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).booleanReturns true if the entity has a composite id.booleanMethods inherited from class org.springframework.data.jpa.repository.support.JpaEntityInformationSupport
getEntityInformationMethods inherited from class org.springframework.data.repository.core.support.AbstractEntityInformation
getJavaTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.repository.core.EntityInformation
getRequiredIdMethods inherited from interface org.springframework.data.repository.core.EntityMetadata
getJavaTypeMethods inherited from interface org.springframework.data.jpa.repository.support.JpaEntityInformation
getRequiredIdAttribute
-
Constructor Details
-
JpaMetamodelEntityInformation
public JpaMetamodelEntityInformation(Class<T> domainClass, jakarta.persistence.metamodel.Metamodel metamodel, jakarta.persistence.PersistenceUnitUtil persistenceUnitUtil) Creates a newJpaMetamodelEntityInformationfor the given domain class andMetamodel.- Parameters:
domainClass- must not be null.metamodel- must not be null.persistenceUnitUtil- must not be null.
-
-
Method Details
-
getEntityName
Description copied from interface:JpaEntityMetadataReturns the name of the entity.- Specified by:
getEntityNamein interfaceJpaEntityMetadata<T>- Overrides:
getEntityNamein classJpaEntityInformationSupport<T,ID> - Returns:
-
getId
-
getIdType
-
getIdAttribute
Description copied from interface:JpaEntityInformationReturns the id attribute of the entity. -
hasCompositeId
public boolean hasCompositeId()Description copied from interface:JpaEntityInformationReturns true if the entity has a composite id. -
getIdAttributeNames
Description copied from interface:JpaEntityInformationReturns 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
Description copied from interface:JpaEntityInformationExtracts 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.
-
isNew
- Specified by:
isNewin interfaceEntityInformation<T,ID> - Overrides:
isNewin classAbstractEntityInformation<T,ID>
-
getKeyset
Description copied from interface:JpaEntityInformationExtract 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.
-