Class JpaMetamodelMappingContext
java.lang.Object
org.springframework.data.mapping.context.AbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,JpaPersistentProperty>
org.springframework.data.jpa.mapping.JpaMetamodelMappingContext
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
,ApplicationContextAware
,ApplicationEventPublisherAware
,EnvironmentAware
,MappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty>
public class JpaMetamodelMappingContext
extends AbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,JpaPersistentProperty>
MappingContext
implementation based on a Jpa Metamodel
.- Since:
- 1.3
- Author:
- Oliver Gierke, Christoph Strobl, Mark Paluch, David Madden
-
Constructor Summary
ConstructorDescriptionJpaMetamodelMappingContext
(Set<jakarta.persistence.metamodel.Metamodel> models) Creates a new JPAMetamodel
basedMappingContext
. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>
createPersistentEntity
(TypeInformation<T> typeInformation) protected JpaPersistentProperty
createPersistentProperty
(Property property, org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?> owner, SimpleTypeHolder simpleTypeHolder) findPersistentPropertyPaths
(Class<T> type, Predicate<? super JpaPersistentProperty> predicate) We customize the lookup ofPersistentPropertyPaths
by also traversing properties that are embeddables.boolean
hasPersistentEntityFor
(Class<?> type) protected boolean
Methods inherited from class org.springframework.data.mapping.context.AbstractMappingContext
addPersistentEntity, addPersistentEntity, afterPropertiesSet, doFindPersistentPropertyPaths, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, getPersistentPropertyPath, initialize, setApplicationContext, setApplicationEventPublisher, setBeanFactory, setEnvironment, setInitialEntitySet, setManagedTypes, setSimpleTypeHolder, setStrict, shouldCreateProperties
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mapping.context.MappingContext
getRequiredPersistentEntity, getRequiredPersistentEntity, getRequiredPersistentEntity
-
Constructor Details
-
JpaMetamodelMappingContext
Creates a new JPAMetamodel
basedMappingContext
.- Parameters:
models
- must not be null or empty.
-
-
Method Details
-
createPersistentEntity
protected <T> org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?> createPersistentEntity(TypeInformation<T> typeInformation) - Specified by:
createPersistentEntity
in classAbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty>
-
createPersistentProperty
protected JpaPersistentProperty createPersistentProperty(Property property, org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?> owner, SimpleTypeHolder simpleTypeHolder) - Specified by:
createPersistentProperty
in classAbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty>
-
shouldCreatePersistentEntityFor
- Overrides:
shouldCreatePersistentEntityFor
in classAbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty>
-
findPersistentPropertyPaths
public <T> PersistentPropertyPaths<T,JpaPersistentProperty> findPersistentPropertyPaths(Class<T> type, Predicate<? super JpaPersistentProperty> predicate) We customize the lookup ofPersistentPropertyPaths
by also traversing properties that are embeddables.- Specified by:
findPersistentPropertyPaths
in interfaceMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty> - Overrides:
findPersistentPropertyPaths
in classAbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty> - See Also:
-
hasPersistentEntityFor
- Specified by:
hasPersistentEntityFor
in interfaceMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty> - Overrides:
hasPersistentEntityFor
in classAbstractMappingContext<org.springframework.data.jpa.mapping.JpaPersistentEntityImpl<?>,
JpaPersistentProperty>
-