Class Configuration

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

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

    • environment Link icon

      protected Environment environment
    • safeRowBoundsEnabled Link icon

      protected boolean safeRowBoundsEnabled
    • safeResultHandlerEnabled Link icon

      protected boolean safeResultHandlerEnabled
    • mapUnderscoreToCamelCase Link icon

      protected boolean mapUnderscoreToCamelCase
    • aggressiveLazyLoading Link icon

      protected boolean aggressiveLazyLoading
    • useGeneratedKeys Link icon

      protected boolean useGeneratedKeys
    • useColumnLabel Link icon

      protected boolean useColumnLabel
    • cacheEnabled Link icon

      protected boolean cacheEnabled
    • callSettersOnNulls Link icon

      protected boolean callSettersOnNulls
    • useActualParamName Link icon

      protected boolean useActualParamName
    • returnInstanceForEmptyRow Link icon

      protected boolean returnInstanceForEmptyRow
    • shrinkWhitespacesInSql Link icon

      protected boolean shrinkWhitespacesInSql
    • nullableOnForEach Link icon

      protected boolean nullableOnForEach
    • argNameBasedConstructorAutoMapping Link icon

      protected boolean argNameBasedConstructorAutoMapping
    • logPrefix Link icon

      protected String logPrefix
    • logImpl Link icon

      protected Class<? extends Log> logImpl
    • vfsImpl Link icon

      protected Class<? extends VFS> vfsImpl
    • defaultSqlProviderType Link icon

      protected Class<?> defaultSqlProviderType
    • localCacheScope Link icon

      protected LocalCacheScope localCacheScope
    • jdbcTypeForNull Link icon

      protected JdbcType jdbcTypeForNull
    • lazyLoadTriggerMethods Link icon

      protected Set<String> lazyLoadTriggerMethods
    • defaultStatementTimeout Link icon

      protected Integer defaultStatementTimeout
    • defaultFetchSize Link icon

      protected Integer defaultFetchSize
    • defaultResultSetType Link icon

      protected ResultSetType defaultResultSetType
    • defaultExecutorType Link icon

      protected ExecutorType defaultExecutorType
    • autoMappingBehavior Link icon

      protected AutoMappingBehavior autoMappingBehavior
    • autoMappingUnknownColumnBehavior Link icon

      protected AutoMappingUnknownColumnBehavior autoMappingUnknownColumnBehavior
    • variables Link icon

      protected Properties variables
    • reflectorFactory Link icon

      protected ReflectorFactory reflectorFactory
    • objectFactory Link icon

      protected ObjectFactory objectFactory
    • objectWrapperFactory Link icon

      protected ObjectWrapperFactory objectWrapperFactory
    • lazyLoadingEnabled Link icon

      protected boolean lazyLoadingEnabled
    • proxyFactory Link icon

      protected ProxyFactory proxyFactory
    • databaseId Link icon

      protected String databaseId
    • configurationFactory Link icon

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

      protected final MapperRegistry mapperRegistry
    • interceptorChain Link icon

      protected final InterceptorChain interceptorChain
    • typeHandlerRegistry Link icon

      protected final TypeHandlerRegistry typeHandlerRegistry
    • typeAliasRegistry Link icon

      protected final TypeAliasRegistry typeAliasRegistry
    • languageRegistry Link icon

      protected final LanguageDriverRegistry languageRegistry
    • mappedStatements Link icon

      protected final Map<String,MappedStatement> mappedStatements
    • caches Link icon

      protected final Map<String,Cache> caches
    • resultMaps Link icon

      protected final Map<String,ResultMap> resultMaps
    • parameterMaps Link icon

      protected final Map<String,ParameterMap> parameterMaps
    • keyGenerators Link icon

      protected final Map<String,KeyGenerator> keyGenerators
    • loadedResources Link icon

      protected final Set<String> loadedResources
    • sqlFragments Link icon

      protected final Map<String,XNode> sqlFragments
    • incompleteStatements Link icon

      protected final Collection<XMLStatementBuilder> incompleteStatements
    • incompleteCacheRefs Link icon

      protected final Collection<CacheRefResolver> incompleteCacheRefs
    • incompleteResultMaps Link icon

      protected final Collection<ResultMapResolver> incompleteResultMaps
    • incompleteMethods Link icon

      protected final Collection<MethodResolver> incompleteMethods
    • cacheRefMap Link icon

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

    • Configuration Link icon

      public Configuration(Environment environment)
    • Configuration Link icon

      public Configuration()
  • Method Details Link icon

    • getLogPrefix Link icon

      public String getLogPrefix()
    • setLogPrefix Link icon

      public void setLogPrefix(String logPrefix)
    • getLogImpl Link icon

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

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

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

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

      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 Link icon

      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 Link icon

      public boolean isCallSettersOnNulls()
    • setCallSettersOnNulls Link icon

      public void setCallSettersOnNulls(boolean callSettersOnNulls)
    • isUseActualParamName Link icon

      public boolean isUseActualParamName()
    • setUseActualParamName Link icon

      public void setUseActualParamName(boolean useActualParamName)
    • isReturnInstanceForEmptyRow Link icon

      public boolean isReturnInstanceForEmptyRow()
    • setReturnInstanceForEmptyRow Link icon

      public void setReturnInstanceForEmptyRow(boolean returnEmptyInstance)
    • isShrinkWhitespacesInSql Link icon

      public boolean isShrinkWhitespacesInSql()
    • setShrinkWhitespacesInSql Link icon

      public void setShrinkWhitespacesInSql(boolean shrinkWhitespacesInSql)
    • setNullableOnForEach Link icon

      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 Link icon

      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 Link icon

      public boolean isArgNameBasedConstructorAutoMapping()
    • setArgNameBasedConstructorAutoMapping Link icon

      public void setArgNameBasedConstructorAutoMapping(boolean argNameBasedConstructorAutoMapping)
    • getDatabaseId Link icon

      public String getDatabaseId()
    • setDatabaseId Link icon

      public void setDatabaseId(String databaseId)
    • getConfigurationFactory Link icon

      public Class<?> getConfigurationFactory()
    • setConfigurationFactory Link icon

      public void setConfigurationFactory(Class<?> configurationFactory)
    • isSafeResultHandlerEnabled Link icon

      public boolean isSafeResultHandlerEnabled()
    • setSafeResultHandlerEnabled Link icon

      public void setSafeResultHandlerEnabled(boolean safeResultHandlerEnabled)
    • isSafeRowBoundsEnabled Link icon

      public boolean isSafeRowBoundsEnabled()
    • setSafeRowBoundsEnabled Link icon

      public void setSafeRowBoundsEnabled(boolean safeRowBoundsEnabled)
    • isMapUnderscoreToCamelCase Link icon

      public boolean isMapUnderscoreToCamelCase()
    • setMapUnderscoreToCamelCase Link icon

      public void setMapUnderscoreToCamelCase(boolean mapUnderscoreToCamelCase)
    • addLoadedResource Link icon

      public void addLoadedResource(String resource)
    • isResourceLoaded Link icon

      public boolean isResourceLoaded(String resource)
    • getEnvironment Link icon

      public Environment getEnvironment()
    • setEnvironment Link icon

      public void setEnvironment(Environment environment)
    • getAutoMappingBehavior Link icon

      public AutoMappingBehavior getAutoMappingBehavior()
    • setAutoMappingBehavior Link icon

      public void setAutoMappingBehavior(AutoMappingBehavior autoMappingBehavior)
    • getAutoMappingUnknownColumnBehavior Link icon

      public AutoMappingUnknownColumnBehavior getAutoMappingUnknownColumnBehavior()
      Gets the auto mapping unknown column behavior.
      Returns:
      the auto mapping unknown column behavior
      Since:
      3.4.0
    • setAutoMappingUnknownColumnBehavior Link icon

      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 Link icon

      public boolean isLazyLoadingEnabled()
    • setLazyLoadingEnabled Link icon

      public void setLazyLoadingEnabled(boolean lazyLoadingEnabled)
    • getProxyFactory Link icon

      public ProxyFactory getProxyFactory()
    • setProxyFactory Link icon

      public void setProxyFactory(ProxyFactory proxyFactory)
    • isAggressiveLazyLoading Link icon

      public boolean isAggressiveLazyLoading()
    • setAggressiveLazyLoading Link icon

      public void setAggressiveLazyLoading(boolean aggressiveLazyLoading)
    • isMultipleResultSetsEnabled Link icon

      @Deprecated public boolean isMultipleResultSetsEnabled()
      Deprecated.
      You can safely remove the call to this method as this option had no effect.
    • setMultipleResultSetsEnabled Link icon

      @Deprecated public void setMultipleResultSetsEnabled(boolean multipleResultSetsEnabled)
      Deprecated.
      You can safely remove the call to this method as this option had no effect.
    • getLazyLoadTriggerMethods Link icon

      public Set<String> getLazyLoadTriggerMethods()
    • setLazyLoadTriggerMethods Link icon

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

      public boolean isUseGeneratedKeys()
    • setUseGeneratedKeys Link icon

      public void setUseGeneratedKeys(boolean useGeneratedKeys)
    • getDefaultExecutorType Link icon

      public ExecutorType getDefaultExecutorType()
    • setDefaultExecutorType Link icon

      public void setDefaultExecutorType(ExecutorType defaultExecutorType)
    • isCacheEnabled Link icon

      public boolean isCacheEnabled()
    • setCacheEnabled Link icon

      public void setCacheEnabled(boolean cacheEnabled)
    • getDefaultStatementTimeout Link icon

      public Integer getDefaultStatementTimeout()
    • setDefaultStatementTimeout Link icon

      public void setDefaultStatementTimeout(Integer defaultStatementTimeout)
    • getDefaultFetchSize Link icon

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

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

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

      public void setDefaultResultSetType(ResultSetType defaultResultSetType)
      Sets the default result set type.
      Parameters:
      defaultResultSetType - the new default result set type
      Since:
      3.5.2
    • isUseColumnLabel Link icon

      public boolean isUseColumnLabel()
    • setUseColumnLabel Link icon

      public void setUseColumnLabel(boolean useColumnLabel)
    • getLocalCacheScope Link icon

      public LocalCacheScope getLocalCacheScope()
    • setLocalCacheScope Link icon

      public void setLocalCacheScope(LocalCacheScope localCacheScope)
    • getJdbcTypeForNull Link icon

      public JdbcType getJdbcTypeForNull()
    • setJdbcTypeForNull Link icon

      public void setJdbcTypeForNull(JdbcType jdbcTypeForNull)
    • getVariables Link icon

      public Properties getVariables()
    • setVariables Link icon

      public void setVariables(Properties variables)
    • getTypeHandlerRegistry Link icon

      public TypeHandlerRegistry getTypeHandlerRegistry()
    • setDefaultEnumTypeHandler Link icon

      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 Link icon

      public TypeAliasRegistry getTypeAliasRegistry()
    • getMapperRegistry Link icon

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

      public ReflectorFactory getReflectorFactory()
    • setReflectorFactory Link icon

      public void setReflectorFactory(ReflectorFactory reflectorFactory)
    • getObjectFactory Link icon

      public ObjectFactory getObjectFactory()
    • setObjectFactory Link icon

      public void setObjectFactory(ObjectFactory objectFactory)
    • getObjectWrapperFactory Link icon

      public ObjectWrapperFactory getObjectWrapperFactory()
    • setObjectWrapperFactory Link icon

      public void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory)
    • getInterceptors Link icon

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

      public LanguageDriverRegistry getLanguageRegistry()
    • setDefaultScriptingLanguage Link icon

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

      public LanguageDriver getDefaultScriptingLanguageInstance()
    • getLanguageDriver Link icon

      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 Link icon

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

      public MetaObject newMetaObject(Object object)
    • newParameterHandler Link icon

      public ParameterHandler newParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql)
    • newResultSetHandler Link icon

      public ResultSetHandler newResultSetHandler(Executor executor, MappedStatement mappedStatement, RowBounds rowBounds, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql)
    • newStatementHandler Link icon

      public StatementHandler newStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
    • newExecutor Link icon

      public Executor newExecutor(Transaction transaction)
    • newExecutor Link icon

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

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

      public Collection<String> getKeyGeneratorNames()
    • getKeyGenerators Link icon

      public Collection<KeyGenerator> getKeyGenerators()
    • getKeyGenerator Link icon

      public KeyGenerator getKeyGenerator(String id)
    • hasKeyGenerator Link icon

      public boolean hasKeyGenerator(String id)
    • addCache Link icon

      public void addCache(Cache cache)
    • getCacheNames Link icon

      public Collection<String> getCacheNames()
    • getCaches Link icon

      public Collection<Cache> getCaches()
    • getCache Link icon

      public Cache getCache(String id)
    • hasCache Link icon

      public boolean hasCache(String id)
    • addResultMap Link icon

      public void addResultMap(ResultMap rm)
    • getResultMapNames Link icon

      public Collection<String> getResultMapNames()
    • getResultMaps Link icon

      public Collection<ResultMap> getResultMaps()
    • getResultMap Link icon

      public ResultMap getResultMap(String id)
    • hasResultMap Link icon

      public boolean hasResultMap(String id)
    • addParameterMap Link icon

      public void addParameterMap(ParameterMap pm)
    • getParameterMapNames Link icon

      public Collection<String> getParameterMapNames()
    • getParameterMaps Link icon

      public Collection<ParameterMap> getParameterMaps()
    • getParameterMap Link icon

      public ParameterMap getParameterMap(String id)
    • hasParameterMap Link icon

      public boolean hasParameterMap(String id)
    • addMappedStatement Link icon

      public void addMappedStatement(MappedStatement ms)
    • getMappedStatementNames Link icon

      public Collection<String> getMappedStatementNames()
    • getMappedStatements Link icon

      public Collection<MappedStatement> getMappedStatements()
    • getIncompleteStatements Link icon

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

      public void addIncompleteStatement(XMLStatementBuilder incompleteStatement)
    • getIncompleteCacheRefs Link icon

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

      public void addIncompleteCacheRef(CacheRefResolver incompleteCacheRef)
    • getIncompleteResultMaps Link icon

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

      public void addIncompleteResultMap(ResultMapResolver resultMapResolver)
    • addIncompleteMethod Link icon

      public void addIncompleteMethod(MethodResolver builder)
    • getIncompleteMethods Link icon

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

      public MappedStatement getMappedStatement(String id)
    • getMappedStatement Link icon

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

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

      public void addInterceptor(Interceptor interceptor)
    • addMappers Link icon

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

      public void addMappers(String packageName)
    • addMapper Link icon

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

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

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

      public boolean hasStatement(String statementName)
    • hasStatement Link icon

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

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

      protected void buildAllStatements()
    • parsePendingMethods Link icon

      public void parsePendingMethods(boolean reportUnresolved)
    • parsePendingStatements Link icon

      public void parsePendingStatements(boolean reportUnresolved)
    • parsePendingCacheRefs Link icon

      public void parsePendingCacheRefs(boolean reportUnresolved)
    • parsePendingResultMaps Link icon

      public void parsePendingResultMaps(boolean reportUnresolved)
    • extractNamespace Link icon

      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 Link icon

      protected void checkGloballyForDiscriminatedNestedResultMaps(ResultMap rm)
    • checkLocallyForDiscriminatedNestedResultMaps Link icon

      protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm)