@java.lang.SuppressWarnings("rawtypes") public interface MappingContext
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 |
---|---|---|
|
public void |
addEntityValidator(PersistentEntity entity, org.springframework.validation.Validator validator) Adds a validator to be used by the entity for validation |
|
public PersistentEntity |
addExternalPersistentEntity(java.lang.Class javaClass) Adds a persistent entity that is not mapped by this MappingContext instance. |
|
public void |
addMappingContextListener(Listener listener) Adds a new mapping context listener instance |
|
public java.util.Collection<PersistentEntity> |
addPersistentEntities(java.lang.Class javaClasses) Adds several PersistentEntity instances |
|
public PersistentEntity |
addPersistentEntity(java.lang.Class javaClass) Adds a PersistentEntity instance |
|
public PersistentEntity |
addPersistentEntity(java.lang.Class javaClass, boolean override) Adds a PersistentEntity instance |
|
public void |
addTypeConverter(org.springframework.core.convert.converter.Converter converter) Add a converter used to convert property values to and from the datastore |
|
public PersistentEntity |
createEmbeddedEntity(java.lang.Class type) |
|
public EntityAccess |
createEntityAccess(PersistentEntity entity, java.lang.Object instance) Creates an EntityAccess instance for the given entity and instance of said entity |
|
public java.util.Collection<PersistentEntity> |
getChildEntities(PersistentEntity root) Obtains all of the children for the given root |
|
public PersistentEntity |
getChildEntityByDiscriminator(PersistentEntity root, java.lang.String discriminator) Obtains a child of the given root entity using the given discriminator |
|
public org.springframework.core.convert.ConversionService |
getConversionService() Obtains the ConversionService instance to use for type conversion |
|
public org.springframework.core.convert.converter.ConverterRegistry |
getConverterRegistry() Obtains the converter registry |
|
public java.util.Collection<PersistentEntity> |
getDirectChildEntities(PersistentEntity root) Obtains only the direct children (1 level down) for the given root entity |
|
public EntityReflector |
getEntityReflector(PersistentEntity entity) Obtains a EntityReflector instance for the given entity |
|
public org.springframework.validation.Validator |
getEntityValidator(PersistentEntity entity) Obtains a validator for the given entity |
|
public MappingFactory |
getMappingFactory() Obtains the MappingFactory instance |
|
public MappingConfigurationStrategy |
getMappingSyntaxStrategy() Returns the syntax reader used to interpret the entity mapping syntax |
|
public MultiTenancyMode |
getMultiTenancyMode()
|
|
public java.util.Collection<PersistentEntity> |
getPersistentEntities() Obtains a list of PersistentEntity instances |
|
public PersistentEntity |
getPersistentEntity(java.lang.String name) Obtains a PersistentEntity by name |
|
public ProxyFactory |
getProxyFactory() Factory used for creating proxies |
|
public ProxyHandler |
getProxyHandler() For handling proxies |
|
public ValidatorRegistry |
getValidatorRegistry()
|
|
public boolean |
isInInheritanceHierarchy(PersistentEntity entity) Returns true if the given entity is in an inheritance hierarchy |
|
public boolean |
isPersistentEntity(java.lang.Class type) Returns whether the specified class is a persistent entity |
|
public boolean |
isPersistentEntity(java.lang.Object value) Returns whether the specified value is a persistent entity |
|
public void |
setProxyFactory(ProxyFactory factory) Factory to use for creating proxies |
|
public 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