Interface MappingContext<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>  
- All Known Implementing Classes:
- AbstractMappingContext
public interface MappingContext<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>  
This interface defines the overall context including all known PersistentEntity instances and methods to obtain
 instances on demand. it is used internally to establish associations between entities and also at runtime to obtain
 entities by name.
- Author:
- Oliver Gierke, Jon Brisbin, Graeme Rocher, Mark Paluch, Christoph Strobl, Johannes Englmeier
- 
Method SummaryModifier and TypeMethodDescription<T> PersistentPropertyPaths<T,P> findPersistentPropertyPaths(Class<T> type, Predicate<? super P> predicate) Returns allPersistentPropertyPaths pointing to properties on the given type that match the givenPredicate.Returns allPersistentEntitys held in the context.getPersistentEntity(Class<?> type) Returns aPersistentEntityfor the givenClass.getPersistentEntity(TypeInformation<?> type) Returns aPersistentEntityfor the givenTypeInformation.getPersistentEntity(P persistentProperty) Returns thePersistentEntitymapped by the givenPersistentProperty.getPersistentPropertyPath(String propertyPath, Class<?> type) Returns allPersistentPropertys for the given dot path notation based on the given type.getPersistentPropertyPath(String propertyPath, TypeInformation<?> type) Returns allPersistentPropertys for the given dot path notation based on the given type.getPersistentPropertyPath(PropertyPath propertyPath) Returns allPersistentPropertys for the given path expression based on the givenPropertyPath.default EgetRequiredPersistentEntity(Class<?> type) Returns a requiredPersistentEntityfor the givenClass.default EReturns aPersistentEntityfor the givenTypeInformation.default EgetRequiredPersistentEntity(P persistentProperty) Returns thePersistentEntitymapped by the givenPersistentProperty.booleanhasPersistentEntityFor(Class<?> type) Returns whether theMappingContextcurrently contains aPersistentEntityfor the type.
- 
Method Details- 
getPersistentEntitiesCollection<E> getPersistentEntities()Returns allPersistentEntitys held in the context.- Returns:
- never null.
 
- 
getPersistentEntityReturns aPersistentEntityfor the givenClass. Will returnnullfor types that are considered simple ones.- Parameters:
- type- must not be null.
- Returns:
- null if no PersistentEntityfound for type.
- See Also:
 
- 
getRequiredPersistentEntityReturns a requiredPersistentEntityfor the givenClass. Will throwIllegalArgumentExceptionfor types that are considered simple ones.- Parameters:
- type- must not be null.
- Returns:
- never null.
- Throws:
- MappingException- when no- PersistentEntitycan be found for given type.
- Since:
- 2.0
- See Also:
 
- 
hasPersistentEntityForReturns whether theMappingContextcurrently contains aPersistentEntityfor the type.- Parameters:
- type- must not be null.
- Returns:
- true if PersistentEntitypresent for given type.
- Since:
- 1.8
 
- 
getPersistentEntityReturns aPersistentEntityfor the givenTypeInformation. Will returnnullfor types that are considered simple ones.- Parameters:
- type- must not be null.
- Returns:
- null if no PersistentEntityfound forTypeInformation.
- See Also:
 
- 
getRequiredPersistentEntityReturns aPersistentEntityfor the givenTypeInformation. Will throwIllegalArgumentExceptionfor types that are considered simple ones.- Parameters:
- type- must not be null.
- Returns:
- never null.
- Throws:
- MappingException- when no- PersistentEntitycan be found for given- TypeInformation.
- See Also:
 
- 
getPersistentEntityReturns thePersistentEntitymapped by the givenPersistentProperty.- Parameters:
- persistentProperty- must not be null.
- Returns:
- the PersistentEntitymapped by the givenPersistentPropertyor null if noPersistentEntityexists for it or thePersistentPropertydoes not refer to an entity (the type of the property is considered simple seeSimpleTypeHolder.isSimpleType(Class)).
 
- 
getRequiredPersistentEntityReturns thePersistentEntitymapped by the givenPersistentProperty.- Parameters:
- persistentProperty- must not be null.
- Returns:
- the PersistentEntitymapped by the givenPersistentPropertyor null if noPersistentEntityexists for it or thePersistentPropertydoes not refer to an entity (the type of the property is considered simple seeSimpleTypeHolder.isSimpleType(Class)).
- Throws:
- MappingException- when no- PersistentEntitycan be found for given- PersistentProperty.
 
- 
getPersistentPropertyPathPersistentPropertyPath<P> getPersistentPropertyPath(PropertyPath propertyPath) throws InvalidPersistentPropertyPath Returns allPersistentPropertys for the given path expression based on the givenPropertyPath.- Parameters:
- propertyPath- must not be null.
- Returns:
- the PersistentPropertyPathrepresenting the givenPropertyPath.
- Throws:
- InvalidPersistentPropertyPath- in case not all segments of the given- PropertyPathcan be resolved.
 
- 
getPersistentPropertyPathPersistentPropertyPath<P> getPersistentPropertyPath(String propertyPath, Class<?> type) throws InvalidPersistentPropertyPath Returns allPersistentPropertys for the given dot path notation based on the given type.- Parameters:
- propertyPath- must not be null.
- type- must not be null.
- Returns:
- the PersistentPropertyPathrepresenting the given property path on the given type.
- Throws:
- InvalidPersistentPropertyPath- in case not all segments of the given property path can be resolved.
 
- 
getPersistentPropertyPathPersistentPropertyPath<P> getPersistentPropertyPath(String propertyPath, TypeInformation<?> type) throws InvalidPersistentPropertyPath Returns allPersistentPropertys for the given dot path notation based on the given type.- Parameters:
- propertyPath- must not be null.
- type- must not be null.
- Returns:
- the PersistentPropertyPathrepresenting the given property path on the given type.
- Throws:
- InvalidPersistentPropertyPath- in case not all segments of the given property path can be resolved.
- Since:
- 3.2.1
 
- 
findPersistentPropertyPaths<T> PersistentPropertyPaths<T,P> findPersistentPropertyPaths(Class<T> type, Predicate<? super P> predicate) Returns allPersistentPropertyPaths pointing to properties on the given type that match the givenPredicate. In case of circular references the detection will stop at the property that references a type that's already included in the path. Note, that is a potentially expensive operation as results cannot be cached.- Parameters:
- type- must not be null.
- predicate- must not be null.
- Returns:
- Since:
- 2.1
 
- 
getManagedTypesCollection<TypeInformation<?>> getManagedTypes()- Returns:
- all TypeInformations for thePersistentEntitys in theMappingContext.
- Since:
- 1.8
 
 
-