Class Configuration


  • public class Configuration
    extends java.lang.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
      • logPrefix

        protected java.lang.String logPrefix
      • logImpl

        protected java.lang.Class<? extends Log> logImpl
      • vfsImpl

        protected java.lang.Class<? extends VFS> vfsImpl
      • jdbcTypeForNull

        protected JdbcType jdbcTypeForNull
      • lazyLoadTriggerMethods

        protected java.util.Set<java.lang.String> lazyLoadTriggerMethods
      • defaultStatementTimeout

        protected java.lang.Integer defaultStatementTimeout
      • defaultFetchSize

        protected java.lang.Integer defaultFetchSize
      • defaultResultSetType

        protected ResultSetType defaultResultSetType
      • defaultExecutorType

        protected ExecutorType defaultExecutorType
      • variables

        protected java.util.Properties variables
      • lazyLoadingEnabled

        protected boolean lazyLoadingEnabled
      • databaseId

        protected java.lang.String databaseId
      • configurationFactory

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

        protected final java.util.Map<java.lang.String,​MappedStatement> mappedStatements
      • caches

        protected final java.util.Map<java.lang.String,​Cache> caches
      • resultMaps

        protected final java.util.Map<java.lang.String,​ResultMap> resultMaps
      • parameterMaps

        protected final java.util.Map<java.lang.String,​ParameterMap> parameterMaps
      • keyGenerators

        protected final java.util.Map<java.lang.String,​KeyGenerator> keyGenerators
      • loadedResources

        protected final java.util.Set<java.lang.String> loadedResources
      • sqlFragments

        protected final java.util.Map<java.lang.String,​XNode> sqlFragments
      • incompleteStatements

        protected final java.util.Collection<XMLStatementBuilder> incompleteStatements
      • incompleteCacheRefs

        protected final java.util.Collection<CacheRefResolver> incompleteCacheRefs
      • incompleteResultMaps

        protected final java.util.Collection<ResultMapResolver> incompleteResultMaps
      • incompleteMethods

        protected final java.util.Collection<MethodResolver> incompleteMethods
      • cacheRefMap

        protected final java.util.Map<java.lang.String,​java.lang.String> cacheRefMap
    • Constructor Detail

      • Configuration

        public Configuration​(Environment environment)
      • Configuration

        public Configuration()
    • Method Detail

      • getLogPrefix

        public java.lang.String getLogPrefix()
      • setLogPrefix

        public void setLogPrefix​(java.lang.String logPrefix)
      • getLogImpl

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

        public void setLogImpl​(java.lang.Class<? extends Log> logImpl)
      • getVfsImpl

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

        public void setVfsImpl​(java.lang.Class<? extends VFS> vfsImpl)
      • 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)
      • getDatabaseId

        public java.lang.String getDatabaseId()
      • setDatabaseId

        public void setDatabaseId​(java.lang.String databaseId)
      • getConfigurationFactory

        public java.lang.Class<?> getConfigurationFactory()
      • setConfigurationFactory

        public void setConfigurationFactory​(java.lang.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​(java.lang.String resource)
      • isResourceLoaded

        public boolean isResourceLoaded​(java.lang.String resource)
      • setEnvironment

        public void setEnvironment​(Environment environment)
      • setAutoMappingBehavior

        public void setAutoMappingBehavior​(AutoMappingBehavior autoMappingBehavior)
      • setAutoMappingUnknownColumnBehavior

        public void setAutoMappingUnknownColumnBehavior​(AutoMappingUnknownColumnBehavior autoMappingUnknownColumnBehavior)
        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 java.util.Set<java.lang.String> getLazyLoadTriggerMethods()
      • setLazyLoadTriggerMethods

        public void setLazyLoadTriggerMethods​(java.util.Set<java.lang.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 java.lang.Integer getDefaultStatementTimeout()
      • setDefaultStatementTimeout

        public void setDefaultStatementTimeout​(java.lang.Integer defaultStatementTimeout)
      • getDefaultFetchSize

        public java.lang.Integer getDefaultFetchSize()
        Since:
        3.3.0
      • setDefaultFetchSize

        public void setDefaultFetchSize​(java.lang.Integer defaultFetchSize)
        Since:
        3.3.0
      • getDefaultResultSetType

        public ResultSetType getDefaultResultSetType()
        Since:
        3.5.2
      • setDefaultResultSetType

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

        public java.util.Properties getVariables()
      • setVariables

        public void setVariables​(java.util.Properties variables)
      • setDefaultEnumTypeHandler

        public void setDefaultEnumTypeHandler​(java.lang.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
      • getMapperRegistry

        public MapperRegistry getMapperRegistry()
        Since:
        3.2.2
      • setReflectorFactory

        public void setReflectorFactory​(ReflectorFactory reflectorFactory)
      • setObjectFactory

        public void setObjectFactory​(ObjectFactory objectFactory)
      • setObjectWrapperFactory

        public void setObjectWrapperFactory​(ObjectWrapperFactory objectWrapperFactory)
      • getInterceptors

        public java.util.List<Interceptor> getInterceptors()
        Since:
        3.2.2
      • setDefaultScriptingLanguage

        public void setDefaultScriptingLanguage​(java.lang.Class<? extends LanguageDriver> driver)
      • getDefaultScriptingLanguageInstance

        public LanguageDriver getDefaultScriptingLanguageInstance()
      • newMetaObject

        public MetaObject newMetaObject​(java.lang.Object object)
      • addKeyGenerator

        public void addKeyGenerator​(java.lang.String id,
                                    KeyGenerator keyGenerator)
      • getKeyGeneratorNames

        public java.util.Collection<java.lang.String> getKeyGeneratorNames()
      • getKeyGenerators

        public java.util.Collection<KeyGenerator> getKeyGenerators()
      • getKeyGenerator

        public KeyGenerator getKeyGenerator​(java.lang.String id)
      • hasKeyGenerator

        public boolean hasKeyGenerator​(java.lang.String id)
      • addCache

        public void addCache​(Cache cache)
      • getCacheNames

        public java.util.Collection<java.lang.String> getCacheNames()
      • getCaches

        public java.util.Collection<Cache> getCaches()
      • getCache

        public Cache getCache​(java.lang.String id)
      • hasCache

        public boolean hasCache​(java.lang.String id)
      • addResultMap

        public void addResultMap​(ResultMap rm)
      • getResultMapNames

        public java.util.Collection<java.lang.String> getResultMapNames()
      • getResultMaps

        public java.util.Collection<ResultMap> getResultMaps()
      • getResultMap

        public ResultMap getResultMap​(java.lang.String id)
      • hasResultMap

        public boolean hasResultMap​(java.lang.String id)
      • addParameterMap

        public void addParameterMap​(ParameterMap pm)
      • getParameterMapNames

        public java.util.Collection<java.lang.String> getParameterMapNames()
      • getParameterMaps

        public java.util.Collection<ParameterMap> getParameterMaps()
      • getParameterMap

        public ParameterMap getParameterMap​(java.lang.String id)
      • hasParameterMap

        public boolean hasParameterMap​(java.lang.String id)
      • addMappedStatement

        public void addMappedStatement​(MappedStatement ms)
      • getMappedStatementNames

        public java.util.Collection<java.lang.String> getMappedStatementNames()
      • getMappedStatements

        public java.util.Collection<MappedStatement> getMappedStatements()
      • getIncompleteStatements

        public java.util.Collection<XMLStatementBuilder> getIncompleteStatements()
      • addIncompleteStatement

        public void addIncompleteStatement​(XMLStatementBuilder incompleteStatement)
      • getIncompleteCacheRefs

        public java.util.Collection<CacheRefResolver> getIncompleteCacheRefs()
      • addIncompleteCacheRef

        public void addIncompleteCacheRef​(CacheRefResolver incompleteCacheRef)
      • getIncompleteResultMaps

        public java.util.Collection<ResultMapResolver> getIncompleteResultMaps()
      • addIncompleteResultMap

        public void addIncompleteResultMap​(ResultMapResolver resultMapResolver)
      • addIncompleteMethod

        public void addIncompleteMethod​(MethodResolver builder)
      • getIncompleteMethods

        public java.util.Collection<MethodResolver> getIncompleteMethods()
      • getMappedStatement

        public MappedStatement getMappedStatement​(java.lang.String id)
      • getMappedStatement

        public MappedStatement getMappedStatement​(java.lang.String id,
                                                  boolean validateIncompleteStatements)
      • getSqlFragments

        public java.util.Map<java.lang.String,​XNode> getSqlFragments()
      • addInterceptor

        public void addInterceptor​(Interceptor interceptor)
      • addMappers

        public void addMappers​(java.lang.String packageName,
                               java.lang.Class<?> superType)
      • addMappers

        public void addMappers​(java.lang.String packageName)
      • addMapper

        public <T> void addMapper​(java.lang.Class<T> type)
      • getMapper

        public <T> T getMapper​(java.lang.Class<T> type,
                               SqlSession sqlSession)
      • hasMapper

        public boolean hasMapper​(java.lang.Class<?> type)
      • hasStatement

        public boolean hasStatement​(java.lang.String statementName)
      • hasStatement

        public boolean hasStatement​(java.lang.String statementName,
                                    boolean validateIncompleteStatements)
      • addCacheRef

        public void addCacheRef​(java.lang.String namespace,
                                java.lang.String referencedNamespace)
      • buildAllStatements

        protected void buildAllStatements()
      • extractNamespace

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

        protected void checkGloballyForDiscriminatedNestedResultMaps​(ResultMap rm)
      • checkLocallyForDiscriminatedNestedResultMaps

        protected void checkLocallyForDiscriminatedNestedResultMaps​(ResultMap rm)