Package org.apache.ibatis.session
Class Configuration
java.lang.Object
org.apache.ibatis.session.Configuration
- Author:
- Clinton Begin
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected AutoMappingBehavior
protected AutoMappingUnknownColumnBehavior
protected boolean
protected boolean
protected Class
<?> Configuration factory class.protected String
protected ExecutorType
protected Integer
protected ResultSetType
protected Class
<?> protected Integer
protected Environment
protected final Collection
<CacheRefResolver> protected final Collection
<MethodResolver> protected final Collection
<ResultMapResolver> protected final Collection
<XMLStatementBuilder> protected final InterceptorChain
protected JdbcType
protected final Map
<String, KeyGenerator> protected final LanguageDriverRegistry
protected boolean
protected LocalCacheScope
protected String
protected final Map
<String, MappedStatement> protected final MapperRegistry
protected boolean
protected boolean
protected boolean
protected ObjectFactory
protected ObjectWrapperFactory
protected final Map
<String, ParameterMap> protected ProxyFactory
protected ReflectorFactory
protected boolean
protected boolean
protected boolean
protected boolean
protected final TypeAliasRegistry
protected final TypeHandlerRegistry
protected boolean
protected boolean
protected boolean
protected Properties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addCacheRef
(String namespace, String referencedNamespace) void
addIncompleteCacheRef
(CacheRefResolver incompleteCacheRef) void
addIncompleteMethod
(MethodResolver builder) void
addIncompleteResultMap
(ResultMapResolver resultMapResolver) void
addIncompleteStatement
(XMLStatementBuilder incompleteStatement) void
addInterceptor
(Interceptor interceptor) void
addKeyGenerator
(String id, KeyGenerator keyGenerator) void
addLoadedResource
(String resource) void
<T> void
void
addMappers
(String packageName) void
addMappers
(String packageName, Class<?> superType) void
void
protected void
protected void
protected void
protected String
extractNamespace
(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> T
getMapper
(Class<T> type, SqlSession sqlSession) Gets the mapper registry.getResultMap
(String id) boolean
boolean
boolean
boolean
boolean
hasResultMap
(String id) boolean
hasStatement
(String statementName) boolean
hasStatement
(String statementName, boolean validateIncompleteStatements) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Returns the default value of 'nullable' attribute on 'foreach' tag.boolean
isResourceLoaded
(String resource) boolean
boolean
boolean
boolean
boolean
boolean
boolean
newExecutor
(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) void
setAggressiveLazyLoading
(boolean aggressiveLazyLoading) void
setArgNameBasedConstructorAutoMapping
(boolean argNameBasedConstructorAutoMapping) void
setAutoMappingBehavior
(AutoMappingBehavior autoMappingBehavior) void
setAutoMappingUnknownColumnBehavior
(AutoMappingUnknownColumnBehavior autoMappingUnknownColumnBehavior) Sets the auto mapping unknown column behavior.void
setCacheEnabled
(boolean cacheEnabled) void
setCallSettersOnNulls
(boolean callSettersOnNulls) void
setConfigurationFactory
(Class<?> configurationFactory) void
setDatabaseId
(String databaseId) void
setDefaultEnumTypeHandler
(Class<? extends TypeHandler> typeHandler) Set a defaultTypeHandler
class forEnum
.void
setDefaultExecutorType
(ExecutorType defaultExecutorType) void
setDefaultFetchSize
(Integer defaultFetchSize) Sets the default fetch size.void
setDefaultResultSetType
(ResultSetType defaultResultSetType) Sets the default result set type.void
setDefaultScriptingLanguage
(Class<? extends LanguageDriver> driver) void
setDefaultSqlProviderType
(Class<?> defaultSqlProviderType) Sets an applying type when omit a type on sql provider annotation(e.g.void
setDefaultStatementTimeout
(Integer defaultStatementTimeout) void
setEnvironment
(Environment environment) void
setJdbcTypeForNull
(JdbcType jdbcTypeForNull) void
setLazyLoadingEnabled
(boolean lazyLoadingEnabled) void
setLazyLoadTriggerMethods
(Set<String> lazyLoadTriggerMethods) void
setLocalCacheScope
(LocalCacheScope localCacheScope) void
setLogImpl
(Class<? extends Log> logImpl) void
setLogPrefix
(String logPrefix) void
setMapUnderscoreToCamelCase
(boolean mapUnderscoreToCamelCase) void
setMultipleResultSetsEnabled
(boolean multipleResultSetsEnabled) void
setNullableOnForEach
(boolean nullableOnForEach) Sets the default value of 'nullable' attribute on 'foreach' tag.void
setObjectFactory
(ObjectFactory objectFactory) void
setObjectWrapperFactory
(ObjectWrapperFactory objectWrapperFactory) void
setProxyFactory
(ProxyFactory proxyFactory) void
setReflectorFactory
(ReflectorFactory reflectorFactory) void
setReturnInstanceForEmptyRow
(boolean returnEmptyInstance) void
setSafeResultHandlerEnabled
(boolean safeResultHandlerEnabled) void
setSafeRowBoundsEnabled
(boolean safeRowBoundsEnabled) void
setShrinkWhitespacesInSql
(boolean shrinkWhitespacesInSql) void
setUseActualParamName
(boolean useActualParamName) void
setUseColumnLabel
(boolean useColumnLabel) void
setUseGeneratedKeys
(boolean useGeneratedKeys) void
setVariables
(Properties variables) void
setVfsImpl
(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()