org.apache.ibatis.session
Class Configuration

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

public class Configuration
extends Object


Nested Class Summary
protected static class Configuration.StrictMap<V>
           
 
Field Summary
protected  boolean aggressiveLazyLoading
           
protected  AutoMappingBehavior autoMappingBehavior
           
protected  boolean cacheEnabled
           
protected  Map<String,String> cacheRefMap
           
protected  Map<String,Cache> caches
           
protected  String databaseId
           
protected  ExecutorType defaultExecutorType
           
protected  Integer defaultStatementTimeout
           
protected  Environment environment
           
protected  Collection<CacheRefResolver> incompleteCacheRefs
           
protected  Collection<ResultMapResolver> incompleteResultMaps
           
protected  Collection<XMLStatementBuilder> incompleteStatements
           
protected  InterceptorChain interceptorChain
           
protected  JdbcType jdbcTypeForNull
           
protected  Map<String,KeyGenerator> keyGenerators
           
protected  boolean lazyLoadingEnabled
           
protected  Set<String> lazyLoadTriggerMethods
           
protected  Set<String> loadedResources
           
protected  LocalCacheScope localCacheScope
           
protected  Map<String,MappedStatement> mappedStatements
           
protected  MapperRegistry mapperRegistry
           
protected  boolean mapUnderscoreToCamelCase
           
protected  boolean multipleResultSetsEnabled
           
protected  ObjectFactory objectFactory
           
protected  ObjectWrapperFactory objectWrapperFactory
           
protected  Map<String,ParameterMap> parameterMaps
           
protected  Map<String,ResultMap> resultMaps
           
protected  boolean safeResultHandlerEnabled
           
protected  boolean safeRowBoundsEnabled
           
protected  Map<String,XNode> sqlFragments
           
protected  TypeAliasRegistry typeAliasRegistry
           
protected  TypeHandlerRegistry typeHandlerRegistry
           
protected  boolean useColumnLabel
           
protected  boolean useGeneratedKeys
           
protected  Properties variables
           
 
Constructor Summary
Configuration()
           
Configuration(Environment environment)
           
 
Method Summary
 void addCache(Cache cache)
           
 void addCacheRef(String namespace, String referencedNamespace)
           
 void addIncompleteCacheRef(CacheRefResolver incompleteCacheRef)
           
 void addIncompleteResultMap(ResultMapResolver resultMapResolver)
           
 void addIncompleteStatement(XMLStatementBuilder incompleteStatement)
           
 void addInterceptor(Interceptor interceptor)
           
 void addKeyGenerator(String id, KeyGenerator keyGenerator)
           
 void addLoadedResource(String resource)
           
 void addMappedStatement(MappedStatement ms)
           
<T> void
addMapper(Class<T> type)
           
 void addMappers(String packageName)
           
 void addMappers(String packageName, Class<?> superType)
           
 void addParameterMap(ParameterMap pm)
           
 void addResultMap(ResultMap rm)
           
protected  void buildAllStatements()
           
protected  void checkGloballyForDiscriminatedNestedResultMaps(ResultMap rm)
           
protected  void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm)
           
protected  String extractNamespace(String statementId)
           
 AutoMappingBehavior getAutoMappingBehavior()
           
 Cache getCache(String id)
           
 Collection<String> getCacheNames()
           
 Collection<Cache> getCaches()
           
 String getDatabaseId()
           
 ExecutorType getDefaultExecutorType()
           
 Integer getDefaultStatementTimeout()
           
 Environment getEnvironment()
           
 Collection<CacheRefResolver> getIncompleteCacheRefs()
           
 Collection<ResultMapResolver> getIncompleteResultMaps()
           
 Collection<XMLStatementBuilder> getIncompleteStatements()
           
 JdbcType getJdbcTypeForNull()
           
 KeyGenerator getKeyGenerator(String id)
           
 Collection<String> getKeyGeneratorNames()
           
 Collection<KeyGenerator> getKeyGenerators()
           
 Set<String> getLazyLoadTriggerMethods()
           
 LocalCacheScope getLocalCacheScope()
           
 MappedStatement getMappedStatement(String id)
           
 MappedStatement getMappedStatement(String id, boolean validateIncompleteStatements)
           
 Collection<String> getMappedStatementNames()
           
 Collection<MappedStatement> getMappedStatements()
           
<T> T
getMapper(Class<T> type, SqlSession sqlSession)
           
 ObjectFactory getObjectFactory()
           
 ObjectWrapperFactory getObjectWrapperFactory()
           
 ParameterMap getParameterMap(String id)
           
 Collection<String> getParameterMapNames()
           
 Collection<ParameterMap> getParameterMaps()
           
 ResultMap getResultMap(String id)
           
 Collection<String> getResultMapNames()
           
 Collection<ResultMap> getResultMaps()
           
 Map<String,XNode> getSqlFragments()
           
 TypeAliasRegistry getTypeAliasRegistry()
           
 TypeHandlerRegistry getTypeHandlerRegistry()
           
 Properties getVariables()
           
 boolean hasCache(String id)
           
 boolean hasKeyGenerator(String id)
           
 boolean hasMapper(Class<?> type)
           
 boolean hasParameterMap(String id)
           
 boolean hasResultMap(String id)
           
 boolean hasStatement(String statementName)
           
 boolean hasStatement(String statementName, boolean validateIncompleteStatements)
           
 boolean isAggressiveLazyLoading()
           
 boolean isCacheEnabled()
           
 boolean isLazyLoadingEnabled()
           
 boolean isMapUnderscoreToCamelCase()
           
 boolean isMultipleResultSetsEnabled()
           
 boolean isResourceLoaded(String resource)
           
 boolean isSafeResultHandlerEnabled()
           
 boolean isSafeRowBoundsEnabled()
           
 boolean isUseColumnLabel()
           
 boolean isUseGeneratedKeys()
           
 Executor newExecutor(Transaction transaction)
           
 Executor newExecutor(Transaction transaction, ExecutorType executorType)
           
 Executor newExecutor(Transaction transaction, ExecutorType executorType, boolean autoCommit)
           
 MetaObject newMetaObject(Object object)
           
 ParameterHandler newParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql)
           
 ResultSetHandler newResultSetHandler(Executor executor, MappedStatement mappedStatement, RowBounds rowBounds, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql)
           
 StatementHandler newStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
           
 void setAggressiveLazyLoading(boolean aggressiveLazyLoading)
           
 void setAutoMappingBehavior(AutoMappingBehavior autoMappingBehavior)
           
 void setCacheEnabled(boolean cacheEnabled)
           
 void setDatabaseId(String databaseId)
           
 void setDefaultExecutorType(ExecutorType defaultExecutorType)
           
 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 setMapUnderscoreToCamelCase(boolean mapUnderscoreToCamelCase)
           
 void setMultipleResultSetsEnabled(boolean multipleResultSetsEnabled)
           
 void setObjectFactory(ObjectFactory objectFactory)
           
 void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory)
           
 void setSafeResultHandlerEnabled(boolean safeResultHandlerEnabled)
           
 void setSafeRowBoundsEnabled(boolean safeRowBoundsEnabled)
           
 void setUseColumnLabel(boolean useColumnLabel)
           
 void setUseGeneratedKeys(boolean useGeneratedKeys)
           
 void setVariables(Properties variables)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

environment

protected Environment environment

safeRowBoundsEnabled

protected boolean safeRowBoundsEnabled

safeResultHandlerEnabled

protected boolean safeResultHandlerEnabled

mapUnderscoreToCamelCase

protected boolean mapUnderscoreToCamelCase

lazyLoadingEnabled

protected boolean lazyLoadingEnabled

aggressiveLazyLoading

protected boolean aggressiveLazyLoading

multipleResultSetsEnabled

protected boolean multipleResultSetsEnabled

useGeneratedKeys

protected boolean useGeneratedKeys

useColumnLabel

protected boolean useColumnLabel

cacheEnabled

protected boolean cacheEnabled

localCacheScope

protected LocalCacheScope localCacheScope

jdbcTypeForNull

protected JdbcType jdbcTypeForNull

lazyLoadTriggerMethods

protected Set<String> lazyLoadTriggerMethods

defaultStatementTimeout

protected Integer defaultStatementTimeout

defaultExecutorType

protected ExecutorType defaultExecutorType

autoMappingBehavior

protected AutoMappingBehavior autoMappingBehavior

variables

protected Properties variables

objectFactory

protected ObjectFactory objectFactory

objectWrapperFactory

protected ObjectWrapperFactory objectWrapperFactory

mapperRegistry

protected MapperRegistry mapperRegistry

databaseId

protected String databaseId

interceptorChain

protected final InterceptorChain interceptorChain

typeHandlerRegistry

protected final TypeHandlerRegistry typeHandlerRegistry

typeAliasRegistry

protected final TypeAliasRegistry typeAliasRegistry

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

cacheRefMap

protected final Map<String,String> cacheRefMap
Constructor Detail

Configuration

public Configuration(Environment environment)

Configuration

public Configuration()
Method Detail

getDatabaseId

public String getDatabaseId()

setDatabaseId

public void setDatabaseId(String databaseId)

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)

isLazyLoadingEnabled

public boolean isLazyLoadingEnabled()

setLazyLoadingEnabled

public void setLazyLoadingEnabled(boolean lazyLoadingEnabled)

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)

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()

getTypeAliasRegistry

public TypeAliasRegistry getTypeAliasRegistry()

getObjectFactory

public ObjectFactory getObjectFactory()

setObjectFactory

public void setObjectFactory(ObjectFactory objectFactory)

getObjectWrapperFactory

public ObjectWrapperFactory getObjectWrapperFactory()

setObjectWrapperFactory

public void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory)

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)

newExecutor

public Executor newExecutor(Transaction transaction,
                            ExecutorType executorType,
                            boolean autoCommit)

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

public Collection<XMLStatementBuilder> getIncompleteStatements()

addIncompleteStatement

public void addIncompleteStatement(XMLStatementBuilder incompleteStatement)

getIncompleteCacheRefs

public Collection<CacheRefResolver> getIncompleteCacheRefs()

addIncompleteCacheRef

public void addIncompleteCacheRef(CacheRefResolver incompleteCacheRef)

getIncompleteResultMaps

public Collection<ResultMapResolver> getIncompleteResultMaps()

addIncompleteResultMap

public void addIncompleteResultMap(ResultMapResolver resultMapResolver)

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()

extractNamespace

protected String extractNamespace(String statementId)

checkGloballyForDiscriminatedNestedResultMaps

protected void checkGloballyForDiscriminatedNestedResultMaps(ResultMap rm)

checkLocallyForDiscriminatedNestedResultMaps

protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm)


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.