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 | 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 |
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) |
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 |
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 |
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 |
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 |
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 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 addObtains 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 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
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 factory