Package org.apache.ibatis.session
Class Configuration
java.lang.Object
org.apache.ibatis.session.Configuration
- Author:
- Clinton Begin
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected AutoMappingBehaviorprotected AutoMappingUnknownColumnBehaviorprotected booleanprotected booleanprotected Class<?> Configuration factory class.protected Stringprotected ExecutorTypeprotected Integerprotected ResultSetTypeprotected Class<?> protected Integerprotected Environmentprotected final Collection<CacheRefResolver> protected final Collection<MethodResolver> protected final Collection<ResultMapResolver> protected final Collection<XMLStatementBuilder> protected final InterceptorChainprotected JdbcTypeprotected final Map<String, KeyGenerator> protected final LanguageDriverRegistryprotected booleanprotected LocalCacheScopeprotected Stringprotected final Map<String, MappedStatement> protected final MapperRegistryprotected booleanprotected booleanprotected booleanprotected ObjectFactoryprotected ObjectWrapperFactoryprotected final Map<String, ParameterMap> protected ProxyFactoryprotected ReflectorFactoryprotected booleanprotected booleanprotected booleanprotected booleanprotected final TypeAliasRegistryprotected final TypeHandlerRegistryprotected booleanprotected booleanprotected booleanprotected Properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddCacheRef(String namespace, String referencedNamespace) voidaddIncompleteCacheRef(CacheRefResolver incompleteCacheRef) voidaddIncompleteMethod(MethodResolver builder) voidaddIncompleteResultMap(ResultMapResolver resultMapResolver) voidaddIncompleteStatement(XMLStatementBuilder incompleteStatement) voidaddInterceptor(Interceptor interceptor) voidaddKeyGenerator(String id, KeyGenerator keyGenerator) voidaddLoadedResource(String resource) void<T> voidvoidaddMappers(String packageName) voidaddMappers(String packageName, Class<?> superType) voidvoidprotected voidprotected voidprotected voidprotected StringextractNamespace(String statementId) Extracts namespace from fully qualified statement id.Gets the auto mapping unknown column behavior.Class<?> Gets the default fetch size.Gets the default result set type.Deprecated.Class<?> Gets an applying type when omit a type on sql provider annotation(e.g.Gets the interceptors.getLanguageDriver(Class<? extends LanguageDriver> langClass) Gets the language driver.getMappedStatement(String id, boolean validateIncompleteStatements) <T> TgetMapper(Class<T> type, SqlSession sqlSession) Gets the mapper registry.getResultMap(String id) booleanbooleanbooleanbooleanbooleanhasResultMap(String id) booleanhasStatement(String statementName) booleanhasStatement(String statementName, boolean validateIncompleteStatements) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanReturns the default value of 'nullable' attribute on 'foreach' tag.booleanisResourceLoaded(String resource) booleanbooleanbooleanbooleanbooleanbooleanbooleannewExecutor(Transaction transaction) newExecutor(Transaction transaction, ExecutorType executorType) newMetaObject(Object object) newParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql) newResultSetHandler(Executor executor, MappedStatement mappedStatement, RowBounds rowBounds, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql) newStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) voidsetAggressiveLazyLoading(boolean aggressiveLazyLoading) voidsetArgNameBasedConstructorAutoMapping(boolean argNameBasedConstructorAutoMapping) voidsetAutoMappingBehavior(AutoMappingBehavior autoMappingBehavior) voidsetAutoMappingUnknownColumnBehavior(AutoMappingUnknownColumnBehavior autoMappingUnknownColumnBehavior) Sets the auto mapping unknown column behavior.voidsetCacheEnabled(boolean cacheEnabled) voidsetCallSettersOnNulls(boolean callSettersOnNulls) voidsetConfigurationFactory(Class<?> configurationFactory) voidsetDatabaseId(String databaseId) voidsetDefaultEnumTypeHandler(Class<? extends TypeHandler> typeHandler) Set a defaultTypeHandlerclass forEnum.voidsetDefaultExecutorType(ExecutorType defaultExecutorType) voidsetDefaultFetchSize(Integer defaultFetchSize) Sets the default fetch size.voidsetDefaultResultSetType(ResultSetType defaultResultSetType) Sets the default result set type.voidsetDefaultScriptingLanguage(Class<? extends LanguageDriver> driver) voidsetDefaultSqlProviderType(Class<?> defaultSqlProviderType) Sets an applying type when omit a type on sql provider annotation(e.g.voidsetDefaultStatementTimeout(Integer defaultStatementTimeout) voidsetEnvironment(Environment environment) voidsetJdbcTypeForNull(JdbcType jdbcTypeForNull) voidsetLazyLoadingEnabled(boolean lazyLoadingEnabled) voidsetLazyLoadTriggerMethods(Set<String> lazyLoadTriggerMethods) voidsetLocalCacheScope(LocalCacheScope localCacheScope) voidsetLogImpl(Class<? extends Log> logImpl) voidsetLogPrefix(String logPrefix) voidsetMapUnderscoreToCamelCase(boolean mapUnderscoreToCamelCase) voidsetMultipleResultSetsEnabled(boolean multipleResultSetsEnabled) voidsetNullableOnForEach(boolean nullableOnForEach) Sets the default value of 'nullable' attribute on 'foreach' tag.voidsetObjectFactory(ObjectFactory objectFactory) voidsetObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory) voidsetProxyFactory(ProxyFactory proxyFactory) voidsetReflectorFactory(ReflectorFactory reflectorFactory) voidsetReturnInstanceForEmptyRow(boolean returnEmptyInstance) voidsetSafeResultHandlerEnabled(boolean safeResultHandlerEnabled) voidsetSafeRowBoundsEnabled(boolean safeRowBoundsEnabled) voidsetShrinkWhitespacesInSql(boolean shrinkWhitespacesInSql) voidsetUseActualParamName(boolean useActualParamName) voidsetUseColumnLabel(boolean useColumnLabel) voidsetUseGeneratedKeys(boolean useGeneratedKeys) voidsetVariables(Properties variables) voidsetVfsImpl(Class<? extends VFS> vfsImpl)
-
Field Details
-
environment
-
safeRowBoundsEnabled
protected boolean safeRowBoundsEnabled -
safeResultHandlerEnabled
protected boolean safeResultHandlerEnabled -
mapUnderscoreToCamelCase
protected boolean mapUnderscoreToCamelCase -
aggressiveLazyLoading
protected boolean aggressiveLazyLoading -
multipleResultSetsEnabled
protected boolean multipleResultSetsEnabled -
useGeneratedKeys
protected boolean useGeneratedKeys -
useColumnLabel
protected boolean useColumnLabel -
cacheEnabled
protected boolean cacheEnabled -
callSettersOnNulls
protected boolean callSettersOnNulls -
useActualParamName
protected boolean useActualParamName -
returnInstanceForEmptyRow
protected boolean returnInstanceForEmptyRow -
shrinkWhitespacesInSql
protected boolean shrinkWhitespacesInSql -
nullableOnForEach
protected boolean nullableOnForEach -
argNameBasedConstructorAutoMapping
protected boolean argNameBasedConstructorAutoMapping -
logPrefix
-
logImpl
-
vfsImpl
-
defaultSqlProviderType
-
localCacheScope
-
jdbcTypeForNull
-
lazyLoadTriggerMethods
-
defaultStatementTimeout
-
defaultFetchSize
-
defaultResultSetType
-
defaultExecutorType
-
autoMappingBehavior
-
autoMappingUnknownColumnBehavior
-
variables
-
reflectorFactory
-
objectFactory
-
objectWrapperFactory
-
lazyLoadingEnabled
protected boolean lazyLoadingEnabled -
proxyFactory
-
databaseId
-
configurationFactory
Configuration factory class. Used to create Configuration for loading deserialized unread properties.- See Also:
-
mapperRegistry
-
interceptorChain
-
typeHandlerRegistry
-
typeAliasRegistry
-
languageRegistry
-
mappedStatements
-
caches
-
resultMaps
-
parameterMaps
-
keyGenerators
-
loadedResources
-
sqlFragments
-
incompleteStatements
-
incompleteCacheRefs
-
incompleteResultMaps
-
incompleteMethods
-
cacheRefMap
-
-
Constructor Details
-
Configuration
-
Configuration
public Configuration()
-
-
Method Details
-
getLogPrefix
-
setLogPrefix
-
getLogImpl
-
setLogImpl
-
getVfsImpl
-
setVfsImpl
-
getDefaultSqlProviderType
Gets an applying type when omit a type on sql provider annotation(e.g.SelectProvider).- Returns:
- the default type for sql provider annotation
- Since:
- 3.5.6
-
setDefaultSqlProviderType
Sets an applying type when omit a type on sql provider annotation(e.g.SelectProvider).- Parameters:
defaultSqlProviderType- the default type for sql provider annotation- Since:
- 3.5.6
-
isCallSettersOnNulls
public boolean isCallSettersOnNulls() -
setCallSettersOnNulls
public void setCallSettersOnNulls(boolean callSettersOnNulls) -
isUseActualParamName
public boolean isUseActualParamName() -
setUseActualParamName
public void setUseActualParamName(boolean useActualParamName) -
isReturnInstanceForEmptyRow
public boolean isReturnInstanceForEmptyRow() -
setReturnInstanceForEmptyRow
public void setReturnInstanceForEmptyRow(boolean returnEmptyInstance) -
isShrinkWhitespacesInSql
public boolean isShrinkWhitespacesInSql() -
setShrinkWhitespacesInSql
public void setShrinkWhitespacesInSql(boolean shrinkWhitespacesInSql) -
setNullableOnForEach
public void setNullableOnForEach(boolean nullableOnForEach) Sets the default value of 'nullable' attribute on 'foreach' tag.- Parameters:
nullableOnForEach- If nullable, set totrue- Since:
- 3.5.9
-
isNullableOnForEach
public boolean isNullableOnForEach()Returns the default value of 'nullable' attribute on 'foreach' tag.Default is
false.- Returns:
- If nullable, set to
true - Since:
- 3.5.9
-
isArgNameBasedConstructorAutoMapping
public boolean isArgNameBasedConstructorAutoMapping() -
setArgNameBasedConstructorAutoMapping
public void setArgNameBasedConstructorAutoMapping(boolean argNameBasedConstructorAutoMapping) -
getDatabaseId
-
setDatabaseId
-
getConfigurationFactory
-
setConfigurationFactory
-
isSafeResultHandlerEnabled
public boolean isSafeResultHandlerEnabled() -
setSafeResultHandlerEnabled
public void setSafeResultHandlerEnabled(boolean safeResultHandlerEnabled) -
isSafeRowBoundsEnabled
public boolean isSafeRowBoundsEnabled() -
setSafeRowBoundsEnabled
public void setSafeRowBoundsEnabled(boolean safeRowBoundsEnabled) -
isMapUnderscoreToCamelCase
public boolean isMapUnderscoreToCamelCase() -
setMapUnderscoreToCamelCase
public void setMapUnderscoreToCamelCase(boolean mapUnderscoreToCamelCase) -
addLoadedResource
-
isResourceLoaded
-
getEnvironment
-
setEnvironment
-
getAutoMappingBehavior
-
setAutoMappingBehavior
-
getAutoMappingUnknownColumnBehavior
Gets the auto mapping unknown column behavior.- Returns:
- the auto mapping unknown column behavior
- Since:
- 3.4.0
-
setAutoMappingUnknownColumnBehavior
public void setAutoMappingUnknownColumnBehavior(AutoMappingUnknownColumnBehavior autoMappingUnknownColumnBehavior) Sets the auto mapping unknown column behavior.- Parameters:
autoMappingUnknownColumnBehavior- the new auto mapping unknown column behavior- Since:
- 3.4.0
-
isLazyLoadingEnabled
public boolean isLazyLoadingEnabled() -
setLazyLoadingEnabled
public void setLazyLoadingEnabled(boolean lazyLoadingEnabled) -
getProxyFactory
-
setProxyFactory
-
isAggressiveLazyLoading
public boolean isAggressiveLazyLoading() -
setAggressiveLazyLoading
public void setAggressiveLazyLoading(boolean aggressiveLazyLoading) -
isMultipleResultSetsEnabled
public boolean isMultipleResultSetsEnabled() -
setMultipleResultSetsEnabled
public void setMultipleResultSetsEnabled(boolean multipleResultSetsEnabled) -
getLazyLoadTriggerMethods
-
setLazyLoadTriggerMethods
-
isUseGeneratedKeys
public boolean isUseGeneratedKeys() -
setUseGeneratedKeys
public void setUseGeneratedKeys(boolean useGeneratedKeys) -
getDefaultExecutorType
-
setDefaultExecutorType
-
isCacheEnabled
public boolean isCacheEnabled() -
setCacheEnabled
public void setCacheEnabled(boolean cacheEnabled) -
getDefaultStatementTimeout
-
setDefaultStatementTimeout
-
getDefaultFetchSize
Gets the default fetch size.- Returns:
- the default fetch size
- Since:
- 3.3.0
-
setDefaultFetchSize
Sets the default fetch size.- Parameters:
defaultFetchSize- the new default fetch size- Since:
- 3.3.0
-
getDefaultResultSetType
Gets the default result set type.- Returns:
- the default result set type
- Since:
- 3.5.2
-
setDefaultResultSetType
Sets the default result set type.- Parameters:
defaultResultSetType- the new default result set type- Since:
- 3.5.2
-
isUseColumnLabel
public boolean isUseColumnLabel() -
setUseColumnLabel
public void setUseColumnLabel(boolean useColumnLabel) -
getLocalCacheScope
-
setLocalCacheScope
-
getJdbcTypeForNull
-
setJdbcTypeForNull
-
getVariables
-
setVariables
-
getTypeHandlerRegistry
-
setDefaultEnumTypeHandler
- Parameters:
typeHandler- a type handler class forEnum- Since:
- 3.4.5
-
getTypeAliasRegistry
-
getMapperRegistry
Gets the mapper registry.- Returns:
- the mapper registry
- Since:
- 3.2.2
-
getReflectorFactory
-
setReflectorFactory
-
getObjectFactory
-
setObjectFactory
-
getObjectWrapperFactory
-
setObjectWrapperFactory
-
getInterceptors
Gets the interceptors.- Returns:
- the interceptors
- Since:
- 3.2.2
-
getLanguageRegistry
-
setDefaultScriptingLanguage
-
getDefaultScriptingLanguageInstance
-
getLanguageDriver
Gets the language driver.- Parameters:
langClass- the lang class- Returns:
- the language driver
- Since:
- 3.5.1
-
getDefaultScriptingLanuageInstance
Deprecated.Gets the default scripting language instance.- Returns:
- the default scripting language instance
-
newMetaObject
-
newParameterHandler
public ParameterHandler newParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql) -
newResultSetHandler
public ResultSetHandler newResultSetHandler(Executor executor, MappedStatement mappedStatement, RowBounds rowBounds, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql) -
newStatementHandler
public StatementHandler newStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) -
newExecutor
-
newExecutor
-
addKeyGenerator
-
getKeyGeneratorNames
-
getKeyGenerators
-
getKeyGenerator
-
hasKeyGenerator
-
addCache
-
getCacheNames
-
getCaches
-
getCache
-
hasCache
-
addResultMap
-
getResultMapNames
-
getResultMaps
-
getResultMap
-
hasResultMap
-
addParameterMap
-
getParameterMapNames
-
getParameterMaps
-
getParameterMap
-
hasParameterMap
-
addMappedStatement
-
getMappedStatementNames
-
getMappedStatements
-
getIncompleteStatements
-
addIncompleteStatement
-
getIncompleteCacheRefs
-
addIncompleteCacheRef
-
getIncompleteResultMaps
-
addIncompleteResultMap
-
addIncompleteMethod
-
getIncompleteMethods
-
getMappedStatement
-
getMappedStatement
-
getSqlFragments
-
addInterceptor
-
addMappers
-
addMappers
-
addMapper
-
getMapper
-
hasMapper
-
hasStatement
-
hasStatement
-
addCacheRef
-
buildAllStatements
protected void buildAllStatements() -
extractNamespace
Extracts namespace from fully qualified statement id.- Parameters:
statementId- the statement id- Returns:
- namespace or null when id does not contain period.
-
checkGloballyForDiscriminatedNestedResultMaps
-
checkLocallyForDiscriminatedNestedResultMaps
-
getDefaultScriptingLanguageInstance()