Class Configuration


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

      • 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
      • 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
      • lazyLoadingEnabled

        protected boolean lazyLoadingEnabled
      • databaseId

        protected String databaseId
      • configurationFactory

        protected Class<?> configurationFactory
        Configuration factory class. Used to create Configuration for loading deserialized unread properties.
        See Also:
        Issue 300 (google code)
      • loadedResources

        protected final Set<String> loadedResources
    • Constructor Detail

      • Configuration

        public Configuration​(Environment environment)
      • Configuration

        public Configuration()
    • Method Detail

      • 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)
      • setEnvironment

        public void setEnvironment​(Environment environment)
      • 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)
      • 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)
      • setLocalCacheScope

        public void setLocalCacheScope​(LocalCacheScope localCacheScope)
      • getJdbcTypeForNull

        public JdbcType getJdbcTypeForNull()
      • setJdbcTypeForNull

        public void setJdbcTypeForNull​(JdbcType jdbcTypeForNull)
      • setVariables

        public void setVariables​(Properties variables)
      • getMapperRegistry

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

        public void setReflectorFactory​(ReflectorFactory reflectorFactory)
      • setObjectFactory

        public void setObjectFactory​(ObjectFactory objectFactory)
      • setObjectWrapperFactory

        public void setObjectWrapperFactory​(ObjectWrapperFactory objectWrapperFactory)
      • getInterceptors

        public List<Interceptor> getInterceptors()
        Gets the interceptors.
        Returns:
        the interceptors
        Since:
        3.2.2
      • 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
      • addKeyGenerator

        public void addKeyGenerator​(String id,
                                    KeyGenerator keyGenerator)
      • hasKeyGenerator

        public boolean hasKeyGenerator​(String id)
      • addCache

        public void addCache​(Cache cache)
      • hasCache

        public boolean hasCache​(String id)
      • addResultMap

        public void addResultMap​(ResultMap rm)
      • hasResultMap

        public boolean hasResultMap​(String id)
      • addParameterMap

        public void addParameterMap​(ParameterMap pm)
      • hasParameterMap

        public boolean hasParameterMap​(String id)
      • addMappedStatement

        public void addMappedStatement​(MappedStatement ms)
      • addIncompleteStatement

        public void addIncompleteStatement​(XMLStatementBuilder incompleteStatement)
      • addIncompleteCacheRef

        public void addIncompleteCacheRef​(CacheRefResolver incompleteCacheRef)
      • addIncompleteResultMap

        public void addIncompleteResultMap​(ResultMapResolver resultMapResolver)
      • addIncompleteMethod

        public void addIncompleteMethod​(MethodResolver builder)
      • getMappedStatement

        public MappedStatement getMappedStatement​(String id,
                                                  boolean validateIncompleteStatements)
      • 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()
      • 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)