Class Configuration

java.lang.Object
org.apache.ibatis.session.Configuration

public class Configuration extends Object
Author:
Clinton Begin
  • Field Details

    • environment

      protected Environment 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

      protected String logPrefix
    • logImpl

      protected Class<? extends Log> logImpl
    • vfsImpl

      protected Class<? extends VFS> vfsImpl
    • defaultSqlProviderType

      protected Class<?> defaultSqlProviderType
    • localCacheScope

      protected LocalCacheScope localCacheScope
    • jdbcTypeForNull

      protected JdbcType jdbcTypeForNull
    • lazyLoadTriggerMethods

      protected Set<String> lazyLoadTriggerMethods
    • defaultStatementTimeout

      protected Integer defaultStatementTimeout
    • defaultFetchSize

      protected Integer defaultFetchSize
    • defaultResultSetType

      protected ResultSetType defaultResultSetType
    • defaultExecutorType

      protected ExecutorType defaultExecutorType
    • autoMappingBehavior

      protected AutoMappingBehavior autoMappingBehavior
    • autoMappingUnknownColumnBehavior

      protected AutoMappingUnknownColumnBehavior autoMappingUnknownColumnBehavior
    • variables

      protected Properties variables
    • reflectorFactory

      protected ReflectorFactory reflectorFactory
    • objectFactory

      protected ObjectFactory objectFactory
    • objectWrapperFactory

      protected ObjectWrapperFactory objectWrapperFactory
    • lazyLoadingEnabled

      protected boolean lazyLoadingEnabled
    • proxyFactory

      protected ProxyFactory proxyFactory
    • databaseId

      protected String databaseId
    • configurationFactory

      protected Class<?> configurationFactory
      Configuration factory class. Used to create Configuration for loading deserialized unread properties.
      See Also:
    • mapperRegistry

      protected final MapperRegistry mapperRegistry
    • interceptorChain

      protected final InterceptorChain interceptorChain
    • typeHandlerRegistry

      protected final TypeHandlerRegistry typeHandlerRegistry
    • typeAliasRegistry

      protected final TypeAliasRegistry typeAliasRegistry
    • languageRegistry

      protected final LanguageDriverRegistry languageRegistry
    • mappedStatements

      protected final Map<String,MappedStatement> mappedStatements
    • caches

      protected final Map<String,Cache> caches
    • resultMaps

      protected final Map<String,ResultMap> resultMaps
    • parameterMaps

      protected final Map<String,ParameterMap> parameterMaps
    • keyGenerators

      protected final Map<String,KeyGenerator> keyGenerators
    • loadedResources

      protected final Set<String> loadedResources
    • sqlFragments

      protected final Map<String,XNode> sqlFragments
    • incompleteStatements

      protected final Collection<XMLStatementBuilder> incompleteStatements
    • incompleteCacheRefs

      protected final Collection<CacheRefResolver> incompleteCacheRefs
    • incompleteResultMaps

      protected final Collection<ResultMapResolver> incompleteResultMaps
    • incompleteMethods

      protected final Collection<MethodResolver> incompleteMethods
    • cacheRefMap

      protected final Map<String,String> cacheRefMap
  • Constructor Details

    • Configuration

      public Configuration(Environment environment)
    • Configuration

      public Configuration()
  • Method Details

    • getLogPrefix

      public String getLogPrefix()
    • setLogPrefix

      public void setLogPrefix(String logPrefix)
    • getLogImpl

      public Class<? extends Log> getLogImpl()
    • setLogImpl

      public void setLogImpl(Class<? extends Log> logImpl)
    • getVfsImpl

      public Class<? extends VFS> getVfsImpl()
    • setVfsImpl

      public void setVfsImpl(Class<? extends VFS> vfsImpl)
    • getDefaultSqlProviderType

      public Class<?> 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

      public void setDefaultSqlProviderType(Class<?> defaultSqlProviderType)
      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 to true
      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

      public String getDatabaseId()
    • setDatabaseId

      public void setDatabaseId(String databaseId)
    • getConfigurationFactory

      public Class<?> getConfigurationFactory()
    • setConfigurationFactory

      public void setConfigurationFactory(Class<?> configurationFactory)
    • 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

      public void addLoadedResource(String resource)
    • isResourceLoaded

      public boolean isResourceLoaded(String resource)
    • getEnvironment

      public Environment getEnvironment()
    • setEnvironment

      public void setEnvironment(Environment environment)
    • getAutoMappingBehavior

      public AutoMappingBehavior getAutoMappingBehavior()
    • setAutoMappingBehavior

      public void setAutoMappingBehavior(AutoMappingBehavior autoMappingBehavior)
    • getAutoMappingUnknownColumnBehavior

      public AutoMappingUnknownColumnBehavior 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

      public ProxyFactory getProxyFactory()
    • setProxyFactory

      public void setProxyFactory(ProxyFactory proxyFactory)
    • isAggressiveLazyLoading

      public boolean isAggressiveLazyLoading()
    • setAggressiveLazyLoading

      public void setAggressiveLazyLoading(boolean aggressiveLazyLoading)
    • isMultipleResultSetsEnabled

      public boolean isMultipleResultSetsEnabled()
    • setMultipleResultSetsEnabled

      public void setMultipleResultSetsEnabled(boolean multipleResultSetsEnabled)
    • getLazyLoadTriggerMethods

      public Set<String> getLazyLoadTriggerMethods()
    • setLazyLoadTriggerMethods

      public void setLazyLoadTriggerMethods(Set<String> lazyLoadTriggerMethods)
    • isUseGeneratedKeys

      public boolean isUseGeneratedKeys()
    • setUseGeneratedKeys

      public void setUseGeneratedKeys(boolean useGeneratedKeys)
    • getDefaultExecutorType

      public ExecutorType getDefaultExecutorType()
    • setDefaultExecutorType

      public void setDefaultExecutorType(ExecutorType defaultExecutorType)
    • isCacheEnabled

      public boolean isCacheEnabled()
    • setCacheEnabled

      public void setCacheEnabled(boolean cacheEnabled)
    • getDefaultStatementTimeout

      public Integer getDefaultStatementTimeout()
    • setDefaultStatementTimeout

      public void setDefaultStatementTimeout(Integer defaultStatementTimeout)
    • getDefaultFetchSize

      public Integer getDefaultFetchSize()
      Gets the default fetch size.
      Returns:
      the default fetch size
      Since:
      3.3.0
    • setDefaultFetchSize

      public void setDefaultFetchSize(Integer defaultFetchSize)
      Sets the default fetch size.
      Parameters:
      defaultFetchSize - the new default fetch size
      Since:
      3.3.0
    • getDefaultResultSetType

      public ResultSetType getDefaultResultSetType()
      Gets the default result set type.
      Returns:
      the default result set type
      Since:
      3.5.2
    • setDefaultResultSetType

      public void setDefaultResultSetType(ResultSetType defaultResultSetType)
      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

      public LocalCacheScope getLocalCacheScope()
    • setLocalCacheScope

      public void setLocalCacheScope(LocalCacheScope localCacheScope)
    • getJdbcTypeForNull

      public JdbcType getJdbcTypeForNull()
    • setJdbcTypeForNull

      public void setJdbcTypeForNull(JdbcType jdbcTypeForNull)
    • getVariables

      public Properties getVariables()
    • setVariables

      public void setVariables(Properties variables)
    • getTypeHandlerRegistry

      public TypeHandlerRegistry getTypeHandlerRegistry()
    • setDefaultEnumTypeHandler

      public void setDefaultEnumTypeHandler(Class<? extends TypeHandler> typeHandler)
      Set a default TypeHandler class for Enum. A default TypeHandler is EnumTypeHandler.
      Parameters:
      typeHandler - a type handler class for Enum
      Since:
      3.4.5
    • getTypeAliasRegistry

      public TypeAliasRegistry getTypeAliasRegistry()
    • getMapperRegistry

      public MapperRegistry getMapperRegistry()
      Gets the mapper registry.
      Returns:
      the mapper registry
      Since:
      3.2.2
    • getReflectorFactory

      public ReflectorFactory getReflectorFactory()
    • setReflectorFactory

      public void setReflectorFactory(ReflectorFactory reflectorFactory)
    • getObjectFactory

      public ObjectFactory getObjectFactory()
    • setObjectFactory

      public void setObjectFactory(ObjectFactory objectFactory)
    • getObjectWrapperFactory

      public ObjectWrapperFactory getObjectWrapperFactory()
    • setObjectWrapperFactory

      public void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory)
    • getInterceptors

      public List<Interceptor> getInterceptors()
      Gets the interceptors.
      Returns:
      the interceptors
      Since:
      3.2.2
    • getLanguageRegistry

      public LanguageDriverRegistry getLanguageRegistry()
    • setDefaultScriptingLanguage

      public void setDefaultScriptingLanguage(Class<? extends LanguageDriver> driver)
    • getDefaultScriptingLanguageInstance

      public LanguageDriver getDefaultScriptingLanguageInstance()
    • getLanguageDriver

      public LanguageDriver getLanguageDriver(Class<? extends LanguageDriver> langClass)
      Gets the language driver.
      Parameters:
      langClass - the lang class
      Returns:
      the language driver
      Since:
      3.5.1
    • getDefaultScriptingLanuageInstance

      @Deprecated public LanguageDriver getDefaultScriptingLanuageInstance()
      Gets the default scripting language instance.
      Returns:
      the default scripting language instance
    • newMetaObject

      public MetaObject newMetaObject(Object object)
    • 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

      public Executor newExecutor(Transaction transaction)
    • newExecutor

      public Executor newExecutor(Transaction transaction, ExecutorType executorType)
    • addKeyGenerator

      public void addKeyGenerator(String id, KeyGenerator keyGenerator)
    • getKeyGeneratorNames

      public Collection<String> getKeyGeneratorNames()
    • getKeyGenerators

      public Collection<KeyGenerator> getKeyGenerators()
    • getKeyGenerator

      public KeyGenerator getKeyGenerator(String id)
    • hasKeyGenerator

      public boolean hasKeyGenerator(String id)
    • addCache

      public void addCache(Cache cache)
    • getCacheNames

      public Collection<String> getCacheNames()
    • getCaches

      public Collection<Cache> getCaches()
    • getCache

      public Cache getCache(String id)
    • hasCache

      public boolean hasCache(String id)
    • addResultMap

      public void addResultMap(ResultMap rm)
    • getResultMapNames

      public Collection<String> getResultMapNames()
    • getResultMaps

      public Collection<ResultMap> getResultMaps()
    • getResultMap

      public ResultMap getResultMap(String id)
    • hasResultMap

      public boolean hasResultMap(String id)
    • addParameterMap

      public void addParameterMap(ParameterMap pm)
    • getParameterMapNames

      public Collection<String> getParameterMapNames()
    • getParameterMaps

      public Collection<ParameterMap> getParameterMaps()
    • getParameterMap

      public ParameterMap getParameterMap(String id)
    • hasParameterMap

      public boolean hasParameterMap(String id)
    • addMappedStatement

      public void addMappedStatement(MappedStatement ms)
    • getMappedStatementNames

      public Collection<String> getMappedStatementNames()
    • getMappedStatements

      public Collection<MappedStatement> getMappedStatements()
    • getIncompleteStatements

      @Deprecated public Collection<XMLStatementBuilder> getIncompleteStatements()
    • addIncompleteStatement

      public void addIncompleteStatement(XMLStatementBuilder incompleteStatement)
    • getIncompleteCacheRefs

      @Deprecated public Collection<CacheRefResolver> getIncompleteCacheRefs()
    • addIncompleteCacheRef

      public void addIncompleteCacheRef(CacheRefResolver incompleteCacheRef)
    • getIncompleteResultMaps

      @Deprecated public Collection<ResultMapResolver> getIncompleteResultMaps()
    • addIncompleteResultMap

      public void addIncompleteResultMap(ResultMapResolver resultMapResolver)
    • addIncompleteMethod

      public void addIncompleteMethod(MethodResolver builder)
    • getIncompleteMethods

      @Deprecated public Collection<MethodResolver> getIncompleteMethods()
    • getMappedStatement

      public MappedStatement getMappedStatement(String id)
    • getMappedStatement

      public MappedStatement getMappedStatement(String id, boolean validateIncompleteStatements)
    • getSqlFragments

      public Map<String,XNode> getSqlFragments()
    • addInterceptor

      public void addInterceptor(Interceptor interceptor)
    • addMappers

      public void addMappers(String packageName, Class<?> superType)
    • addMappers

      public void addMappers(String packageName)
    • addMapper

      public <T> void addMapper(Class<T> type)
    • getMapper

      public <T> T getMapper(Class<T> type, SqlSession sqlSession)
    • hasMapper

      public boolean hasMapper(Class<?> type)
    • hasStatement

      public boolean hasStatement(String statementName)
    • hasStatement

      public boolean hasStatement(String statementName, boolean validateIncompleteStatements)
    • addCacheRef

      public void addCacheRef(String namespace, String referencedNamespace)
    • buildAllStatements

      protected void buildAllStatements()
    • parsePendingMethods

      public void parsePendingMethods(boolean reportUnresolved)
    • parsePendingStatements

      public void parsePendingStatements(boolean reportUnresolved)
    • parsePendingCacheRefs

      public void parsePendingCacheRefs(boolean reportUnresolved)
    • parsePendingResultMaps

      public void parsePendingResultMaps(boolean reportUnresolved)
    • extractNamespace

      protected String extractNamespace(String statementId)
      Extracts namespace from fully qualified statement id.
      Parameters:
      statementId - the statement id
      Returns:
      namespace or null when id does not contain period.
    • checkGloballyForDiscriminatedNestedResultMaps

      protected void checkGloballyForDiscriminatedNestedResultMaps(ResultMap rm)
    • checkLocallyForDiscriminatedNestedResultMaps

      protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm)