public interface MappingContext<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>
Collection<E> getPersistentEntities()
PersistentEntity
s held in the context.@Nullable E getPersistentEntity(Class<?> type)
PersistentEntity
for the given Class
. Will return null
for types that are
considered simple ones.type
- must not be null.PersistentEntity
found for type.SimpleTypeHolder.isSimpleType(Class)
default E getRequiredPersistentEntity(Class<?> type) throws MappingException
PersistentEntity
for the given Class
. Will throw
IllegalArgumentException
for types that are considered simple ones.type
- must not be null.MappingException
- when no PersistentEntity
can be found for given type.SimpleTypeHolder.isSimpleType(Class)
boolean hasPersistentEntityFor(Class<?> type)
MappingContext
currently contains a PersistentEntity
for the type.type
- must not be null.PersistentEntity
present for given type.@Nullable E getPersistentEntity(TypeInformation<?> type)
PersistentEntity
for the given TypeInformation
. Will return null
for types that
are considered simple ones.type
- must not be null.PersistentEntity
found for TypeInformation
.SimpleTypeHolder.isSimpleType(Class)
default E getRequiredPersistentEntity(TypeInformation<?> type) throws MappingException
PersistentEntity
for the given TypeInformation
. Will throw
IllegalArgumentException
for types that are considered simple ones.type
- must not be null.MappingException
- when no PersistentEntity
can be found for given TypeInformation
.SimpleTypeHolder.isSimpleType(Class)
@Nullable E getPersistentEntity(P persistentProperty)
PersistentEntity
mapped by the given PersistentProperty
.persistentProperty
- must not be null.PersistentEntity
mapped by the given PersistentProperty
or null if no
PersistentEntity
exists for it or the PersistentProperty
does not refer to an entity (the
type of the property is considered simple see
SimpleTypeHolder.isSimpleType(Class)
).default E getRequiredPersistentEntity(P persistentProperty) throws MappingException
PersistentEntity
mapped by the given PersistentProperty
.persistentProperty
- must not be null.PersistentEntity
mapped by the given PersistentProperty
or null if no
PersistentEntity
exists for it or the PersistentProperty
does not refer to an entity (the
type of the property is considered simple see
SimpleTypeHolder.isSimpleType(Class)
).MappingException
- when no PersistentEntity
can be found for given PersistentProperty
.PersistentPropertyPath<P> getPersistentPropertyPath(PropertyPath propertyPath) throws InvalidPersistentPropertyPath
PersistentProperty
s for the given path expression based on the given PropertyPath
.propertyPath
- must not be null.PersistentPropertyPath
representing the given PropertyPath
.InvalidPersistentPropertyPath
- in case not all of the segments of the given PropertyPath
can be
resolved.PersistentPropertyPath<P> getPersistentPropertyPath(String propertyPath, Class<?> type) throws InvalidPersistentPropertyPath
PersistentProperty
s for the given dot path notation based on the given type.propertyPath
- must not be null.type
- must not be null.PersistentPropertyPath
representing the given property path on the given type.InvalidPersistentPropertyPath
- in case not all of the segments of the given property path can be resolved.<T> PersistentPropertyPaths<T,P> findPersistentPropertyPaths(Class<T> type, Predicate<? super P> predicate)
PersistentPropertyPath
s pointing to properties on the given type that match the given
Predicate
. 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 is a potentially expensive operation as results cannot be
cached.type
- must not be null.predicate
- must not be null.Collection<TypeInformation<?>> getManagedTypes()
TypeInformation
s for the PersistentEntity
s in the MappingContext
.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.