Defines the overall context including all known PersistentEntity instances and methods to obtain instances on demand
This interface is used internally to establish associations between entities and also at runtime to obtain entities by name
The generic type parameters T & R are used to specify the mapped form of a class (example Table) and property (example Column) respectively.
Uses instances of the Datastore interface to discover how to persist objects
Modifiers | Name | Description |
---|---|---|
interface |
MappingContext.Listener |
Implementors can register for events when the mapping context changes |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addEntityValidator(PersistentEntity entity, org.springframework.validation.Validator validator) Adds a validator to be used by the entity for validation |
|
PersistentEntity |
addExternalPersistentEntity(java.lang.Class javaClass) Adds a persistent entity that is not mapped by this MappingContext instance. |
|
void |
addMappingContextListener(MappingContext.Listener listener) Adds a new mapping context listener instance |
|
java.util.Collection<PersistentEntity> |
addPersistentEntities(java.lang.Class... javaClasses) Adds several PersistentEntity instances |
|
PersistentEntity |
addPersistentEntity(java.lang.Class javaClass) Adds a PersistentEntity instance |
|
PersistentEntity |
addPersistentEntity(java.lang.Class javaClass, boolean override) Adds a PersistentEntity instance |
|
void |
addTypeConverter(org.springframework.core.convert.converter.Converter converter) Add a converter used to convert property values to and from the datastore |
|
PersistentEntity |
createEmbeddedEntity(java.lang.Class type) |
|
EntityAccess |
createEntityAccess(PersistentEntity entity, java.lang.Object instance) Creates an EntityAccess instance for the given entity and instance of said entity |
|
java.util.Collection<PersistentEntity> |
getChildEntities(PersistentEntity root) Obtains all of the children for the given root |
|
PersistentEntity |
getChildEntityByDiscriminator(PersistentEntity root, java.lang.String discriminator) Obtains a child of the given root entity using the given discriminator |
|
org.springframework.core.convert.ConversionService |
getConversionService() Obtains the ConversionService instance to use for type conversion |
|
org.springframework.core.convert.converter.ConverterRegistry |
getConverterRegistry() Obtains the converter registry |
|
java.util.Collection<PersistentEntity> |
getDirectChildEntities(PersistentEntity root) Obtains only the direct children (1 level down) for the given root entity |
|
EntityReflector |
getEntityReflector(PersistentEntity entity) Obtains a EntityReflector instance for the given entity |
|
org.springframework.validation.Validator |
getEntityValidator(PersistentEntity entity) Obtains a validator for the given entity |
|
MappingFactory |
getMappingFactory() Obtains the MappingFactory instance |
|
MappingConfigurationStrategy |
getMappingSyntaxStrategy() Returns the syntax reader used to interpret the entity mapping syntax |
|
MultiTenancyMode |
getMultiTenancyMode() @return The multi tenancy mode |
|
java.util.Collection<PersistentEntity> |
getPersistentEntities() Obtains a list of PersistentEntity instances |
|
PersistentEntity |
getPersistentEntity(java.lang.String name) Obtains a PersistentEntity by name |
|
ProxyFactory |
getProxyFactory() Factory used for creating proxies |
|
ProxyHandler |
getProxyHandler() For handling proxies |
|
ValidatorRegistry |
getValidatorRegistry() @return Gets the validation registry used by this MappingContext |
|
boolean |
isInInheritanceHierarchy(PersistentEntity entity) Returns true if the given entity is in an inheritance hierarchy |
|
boolean |
isPersistentEntity(java.lang.Class type) Returns whether the specified class is a persistent entity |
|
boolean |
isPersistentEntity(java.lang.Object value) Returns whether the specified value is a persistent entity |
|
void |
setProxyFactory(ProxyFactory factory) Factory to use for creating proxies |
|
void |
setValidatorRegistry(ValidatorRegistry validatorRegistry) Sets the validator registry used by this mapping context |
Adds a validator to be used by the entity for validation
entity
- The PersistentEntityvalidator
- The validatorAdds a persistent entity that is not mapped by this MappingContext instance. Used for cross store persistence
javaClass
- The Java classAdds a new mapping context listener instance
listener
- The listenerAdds several PersistentEntity instances
javaClasses
- The Java class representing the entityAdds a PersistentEntity instance
javaClass
- The Java class representing the entityAdds a PersistentEntity instance
javaClass
- The Java class representing the entityoverride
- Whether to override an existing entityAdd a converter used to convert property values to and from the datastore
converter
- The converter to addCreates an EntityAccess instance for the given entity and instance of said entity
entity
- The entityinstance
- The instanceObtains all of the children for the given root
root
- The rootObtains a child of the given root entity using the given discriminator
root
- The root entitydiscriminator
- The discriminatorObtains the ConversionService instance to use for type conversion
Obtains the converter registry
Obtains only the direct children (1 level down) for the given root entity
root
- The rootObtains a EntityReflector instance for the given entity
entity
- The entityObtains a validator for the given entity
entity
- The entityObtains the MappingFactory instance
Returns the syntax reader used to interpret the entity mapping syntax
Obtains a list of PersistentEntity instances
Obtains a PersistentEntity by name
name
- The name of the entityFactory used for creating proxies
For handling proxies
Returns true if the given entity is in an inheritance hierarchy
entity
- The entityReturns whether the specified class is a persistent entity
type
- The type to checkReturns whether the specified value is a persistent entity
value
- The value to checkFactory to use for creating proxies
factory
- The proxy factorySets the validator registry used by this mapping context
validatorRegistry
- The validator registry