Class RelationalMappingContext
java.lang.Object
org.springframework.data.mapping.context.AbstractMappingContext<RelationalPersistentEntity<?>,RelationalPersistentProperty>
org.springframework.data.relational.core.mapping.RelationalMappingContext
- All Implemented Interfaces:
Aware
,InitializingBean
,ApplicationContextAware
,ApplicationEventPublisherAware
,MappingContext<RelationalPersistentEntity<?>,
RelationalPersistentProperty>
- Direct Known Subclasses:
JdbcMappingContext
,R2dbcMappingContext
public class RelationalMappingContext
extends AbstractMappingContext<RelationalPersistentEntity<?>,RelationalPersistentProperty>
MappingContext
implementation.- Author:
- Jens Schauder, Greg Turnquist, Kazuki Shimizu, Oliver Gierke, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newRelationalMappingContext
.RelationalMappingContext
(NamingStrategy namingStrategy) Creates a newRelationalMappingContext
using the givenNamingStrategy
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyDefaults
(BasicRelationalPersistentProperty persistentProperty) protected <T> RelationalPersistentEntity<T>
createPersistentEntity
(TypeInformation<T> typeInformation) protected RelationalPersistentProperty
createPersistentProperty
(Property property, RelationalPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) getAggregatePath
(PersistentPropertyPath<? extends RelationalPersistentProperty> path) Provides anAggregatePath
for the providedPersistentPropertyPath
.boolean
Return whether quoting should be enabled for all table and column names.boolean
void
setApplicationContext
(ApplicationContext applicationContext) void
setForceQuote
(boolean forceQuote) Enable/disable quoting for all tables and column names.void
setSingleQueryLoadingEnabled
(boolean singleQueryLoadingEnabled) Set the singleQueryLoadingEnabled flag.void
setSqlIdentifierSanitizer
(SqlIdentifierSanitizer sanitizer) Set theSqlIdentifierSanitizer
to sanitizeidentifiers
created from SpEL expressions.Methods inherited from class org.springframework.data.mapping.context.AbstractMappingContext
addPersistentEntity, addPersistentEntity, afterPropertiesSet, doFindPersistentPropertyPaths, findPersistentPropertyPaths, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, initialize, setApplicationEventPublisher, setInitialEntitySet, setManagedTypes, setSimpleTypeHolder, setStrict, shouldCreatePersistentEntityFor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mapping.context.MappingContext
getRequiredPersistentEntity, getRequiredPersistentEntity, getRequiredPersistentEntity
-
Constructor Details
-
RelationalMappingContext
public RelationalMappingContext()Creates a newRelationalMappingContext
. -
RelationalMappingContext
Creates a newRelationalMappingContext
using the givenNamingStrategy
.- Parameters:
namingStrategy
- must not be null.
-
-
Method Details
-
isForceQuote
public boolean isForceQuote()Return whether quoting should be enabled for all table and column names. Quoting is enabled by default.- Returns:
- Since:
- 2.0
-
setForceQuote
public void setForceQuote(boolean forceQuote) Enable/disable quoting for all tables and column names.- Parameters:
forceQuote
-
-
setSqlIdentifierSanitizer
Set theSqlIdentifierSanitizer
to sanitizeidentifiers
created from SpEL expressions.- Parameters:
sanitizer
- must not be null.- Since:
- 3.2
-
getNamingStrategy
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Overrides:
setApplicationContext
in classAbstractMappingContext<RelationalPersistentEntity<?>,
RelationalPersistentProperty> - Throws:
BeansException
-
createPersistentEntity
protected <T> RelationalPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation) - Specified by:
createPersistentEntity
in classAbstractMappingContext<RelationalPersistentEntity<?>,
RelationalPersistentProperty>
-
createPersistentProperty
protected RelationalPersistentProperty createPersistentProperty(Property property, RelationalPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) - Specified by:
createPersistentProperty
in classAbstractMappingContext<RelationalPersistentEntity<?>,
RelationalPersistentProperty>
-
isSingleQueryLoadingEnabled
public boolean isSingleQueryLoadingEnabled()- Returns:
- iff single query loading is enabled.
- Since:
- 3.2
- See Also:
-
setSingleQueryLoadingEnabled
public void setSingleQueryLoadingEnabled(boolean singleQueryLoadingEnabled) Set the singleQueryLoadingEnabled flag. If it is set to true and theDialect
supports it, Spring Data JDBC will try to use Single Query Loading if possible.- Parameters:
singleQueryLoadingEnabled
-- Since:
- 3.2
-
applyDefaults
-
getAggregatePath
public AggregatePath getAggregatePath(PersistentPropertyPath<? extends RelationalPersistentProperty> path) Provides anAggregatePath
for the providedPersistentPropertyPath
.- Parameters:
path
- the path to provide anAggregatePath
for. Must not be null.- Returns:
- an
AggregatePath
on the provided path. - Since:
- 3.2
-
getAggregatePath
-