类 MybatisConfiguration
- java.lang.Object
-
- org.apache.ibatis.session.Configuration
-
- com.baomidou.mybatisplus.core.MybatisConfiguration
-
public class MybatisConfiguration extends org.apache.ibatis.session.Configurationreplace default Configuration classCaratacus 2016/9/25 replace mapperRegistry
- 从以下版本开始:
- 2016-01-23
- 作者:
- hubin
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected classMybatisConfiguration.StrictMap<V>
-
字段概要
字段 修饰符和类型 字段 说明 protected java.util.Map<java.lang.String,org.apache.ibatis.cache.Cache>cachesprotected java.util.Map<java.lang.String,org.apache.ibatis.executor.keygen.KeyGenerator>keyGeneratorsprotected java.util.Map<java.lang.String,org.apache.ibatis.mapping.MappedStatement>mappedStatementsprotected MybatisMapperRegistrymybatisMapperRegistryMapper 注册protected java.util.Map<java.lang.String,org.apache.ibatis.mapping.ParameterMap>parameterMapsprotected java.util.Map<java.lang.String,org.apache.ibatis.mapping.ResultMap>resultMapsprotected java.util.Map<java.lang.String,org.apache.ibatis.parsing.XNode>sqlFragments-
从类继承的字段 org.apache.ibatis.session.Configuration
aggressiveLazyLoading, autoMappingBehavior, autoMappingUnknownColumnBehavior, cacheEnabled, cacheRefMap, callSettersOnNulls, configurationFactory, databaseId, defaultExecutorType, defaultFetchSize, defaultResultSetType, defaultSqlProviderType, defaultStatementTimeout, environment, incompleteCacheRefs, incompleteMethods, incompleteResultMaps, incompleteStatements, interceptorChain, jdbcTypeForNull, languageRegistry, lazyLoadingEnabled, lazyLoadTriggerMethods, loadedResources, localCacheScope, logImpl, logPrefix, mapperRegistry, mapUnderscoreToCamelCase, multipleResultSetsEnabled, nullableOnForEach, objectFactory, objectWrapperFactory, proxyFactory, reflectorFactory, returnInstanceForEmptyRow, safeResultHandlerEnabled, safeRowBoundsEnabled, shrinkWhitespacesInSql, typeAliasRegistry, typeHandlerRegistry, useActualParamName, useColumnLabel, useGeneratedKeys, variables, vfsImpl
-
-
构造器概要
构造器 构造器 说明 MybatisConfiguration()初始化调用MybatisConfiguration(org.apache.ibatis.mapping.Environment environment)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddCache(org.apache.ibatis.cache.Cache cache)voidaddKeyGenerator(java.lang.String id, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator)voidaddMappedStatement(org.apache.ibatis.mapping.MappedStatement ms)MybatisPlus 加载 SQL 顺序:<T> voidaddMapper(java.lang.Class<T> type)使用自己的 MybatisMapperRegistryvoidaddMappers(java.lang.String packageName)使用自己的 MybatisMapperRegistryvoidaddMappers(java.lang.String packageName, java.lang.Class<?> superType)使用自己的 MybatisMapperRegistry<T> voidaddNewMapper(java.lang.Class<T> type)新增注入新的 Mapper 信息,新增前会清理之前的缓存信息voidaddParameterMap(org.apache.ibatis.mapping.ParameterMap pm)voidaddResultMap(org.apache.ibatis.mapping.ResultMap rm)protected voidcheckGloballyForDiscriminatedNestedResultMaps(org.apache.ibatis.mapping.ResultMap rm)protected voidcheckLocallyForDiscriminatedNestedResultMaps(org.apache.ibatis.mapping.ResultMap rm)org.apache.ibatis.cache.CachegetCache(java.lang.String id)java.util.Collection<java.lang.String>getCacheNames()java.util.Collection<org.apache.ibatis.cache.Cache>getCaches()org.apache.ibatis.executor.keygen.KeyGeneratorgetKeyGenerator(java.lang.String id)java.util.Collection<java.lang.String>getKeyGeneratorNames()java.util.Collection<org.apache.ibatis.executor.keygen.KeyGenerator>getKeyGenerators()org.apache.ibatis.mapping.MappedStatementgetMappedStatement(java.lang.String id)org.apache.ibatis.mapping.MappedStatementgetMappedStatement(java.lang.String id, boolean validateIncompleteStatements)java.util.Collection<java.lang.String>getMappedStatementNames()java.util.Collection<org.apache.ibatis.mapping.MappedStatement>getMappedStatements()<T> TgetMapper(java.lang.Class<T> type, org.apache.ibatis.session.SqlSession sqlSession)使用自己的 MybatisMapperRegistryorg.apache.ibatis.binding.MapperRegistrygetMapperRegistry()使用自己的 MybatisMapperRegistryorg.apache.ibatis.mapping.ParameterMapgetParameterMap(java.lang.String id)java.util.Collection<java.lang.String>getParameterMapNames()java.util.Collection<org.apache.ibatis.mapping.ParameterMap>getParameterMaps()org.apache.ibatis.mapping.ResultMapgetResultMap(java.lang.String id)java.util.Collection<java.lang.String>getResultMapNames()java.util.Collection<org.apache.ibatis.mapping.ResultMap>getResultMaps()java.util.Map<java.lang.String,org.apache.ibatis.parsing.XNode>getSqlFragments()booleanhasCache(java.lang.String id)booleanhasKeyGenerator(java.lang.String id)booleanhasMapper(java.lang.Class<?> type)使用自己的 MybatisMapperRegistrybooleanhasParameterMap(java.lang.String id)booleanhasResultMap(java.lang.String id)booleanhasStatement(java.lang.String statementName, boolean validateIncompleteStatements)booleanisUseGeneratedShortKey()是否生成短key缓存org.apache.ibatis.executor.ExecutornewExecutor(org.apache.ibatis.transaction.Transaction transaction, org.apache.ibatis.session.ExecutorType executorType)<T> voidremoveMapper(java.lang.Class<T> type)移除 Mapper 相关缓存,支持 GroovyClassLoader 动态注入 MappervoidsetDefaultScriptingLanguage(java.lang.Class<? extends org.apache.ibatis.scripting.LanguageDriver> driver)指定动态SQL生成的默认语言voidsetUseGeneratedShortKey(boolean useGeneratedShortKey)是否生成短key缓存-
从类继承的方法 org.apache.ibatis.session.Configuration
addCacheRef, addIncompleteCacheRef, addIncompleteMethod, addIncompleteResultMap, addIncompleteStatement, addInterceptor, addLoadedResource, buildAllStatements, extractNamespace, getAutoMappingBehavior, getAutoMappingUnknownColumnBehavior, getConfigurationFactory, getDatabaseId, getDefaultExecutorType, getDefaultFetchSize, getDefaultResultSetType, getDefaultScriptingLanguageInstance, getDefaultScriptingLanuageInstance, getDefaultSqlProviderType, getDefaultStatementTimeout, getEnvironment, getIncompleteCacheRefs, getIncompleteMethods, getIncompleteResultMaps, getIncompleteStatements, getInterceptors, getJdbcTypeForNull, getLanguageDriver, getLanguageRegistry, getLazyLoadTriggerMethods, getLocalCacheScope, getLogImpl, getLogPrefix, getObjectFactory, getObjectWrapperFactory, getProxyFactory, getReflectorFactory, getTypeAliasRegistry, getTypeHandlerRegistry, getVariables, getVfsImpl, hasStatement, isAggressiveLazyLoading, isCacheEnabled, isCallSettersOnNulls, isLazyLoadingEnabled, isMapUnderscoreToCamelCase, isMultipleResultSetsEnabled, isNullableOnForEach, isResourceLoaded, isReturnInstanceForEmptyRow, isSafeResultHandlerEnabled, isSafeRowBoundsEnabled, isShrinkWhitespacesInSql, isUseActualParamName, isUseColumnLabel, isUseGeneratedKeys, newExecutor, newMetaObject, newParameterHandler, newResultSetHandler, newStatementHandler, setAggressiveLazyLoading, setAutoMappingBehavior, setAutoMappingUnknownColumnBehavior, setCacheEnabled, setCallSettersOnNulls, setConfigurationFactory, setDatabaseId, setDefaultEnumTypeHandler, setDefaultExecutorType, setDefaultFetchSize, setDefaultResultSetType, setDefaultSqlProviderType, setDefaultStatementTimeout, setEnvironment, setJdbcTypeForNull, setLazyLoadingEnabled, setLazyLoadTriggerMethods, setLocalCacheScope, setLogImpl, setLogPrefix, setMapUnderscoreToCamelCase, setMultipleResultSetsEnabled, setNullableOnForEach, setObjectFactory, setObjectWrapperFactory, setProxyFactory, setReflectorFactory, setReturnInstanceForEmptyRow, setSafeResultHandlerEnabled, setSafeRowBoundsEnabled, setShrinkWhitespacesInSql, setUseActualParamName, setUseColumnLabel, setUseGeneratedKeys, setVariables, setVfsImpl
-
-
-
-
字段详细资料
-
mybatisMapperRegistry
protected final MybatisMapperRegistry mybatisMapperRegistry
Mapper 注册
-
caches
protected final java.util.Map<java.lang.String,org.apache.ibatis.cache.Cache> caches
-
resultMaps
protected final java.util.Map<java.lang.String,org.apache.ibatis.mapping.ResultMap> resultMaps
-
parameterMaps
protected final java.util.Map<java.lang.String,org.apache.ibatis.mapping.ParameterMap> parameterMaps
-
keyGenerators
protected final java.util.Map<java.lang.String,org.apache.ibatis.executor.keygen.KeyGenerator> keyGenerators
-
sqlFragments
protected final java.util.Map<java.lang.String,org.apache.ibatis.parsing.XNode> sqlFragments
-
mappedStatements
protected final java.util.Map<java.lang.String,org.apache.ibatis.mapping.MappedStatement> mappedStatements
-
-
方法详细资料
-
addMappedStatement
public void addMappedStatement(org.apache.ibatis.mapping.MappedStatement ms)
MybatisPlus 加载 SQL 顺序:1、加载 XML中的 SQL
2、加载 SqlProvider 中的 SQL
3、XmlSql 与 SqlProvider不能包含相同的 SQL
调整后的 SQL优先级:XmlSql > sqlProvider > CurdSql
- 覆盖:
addMappedStatement在类中org.apache.ibatis.session.Configuration
-
getMapperRegistry
public org.apache.ibatis.binding.MapperRegistry getMapperRegistry()
使用自己的 MybatisMapperRegistry- 覆盖:
getMapperRegistry在类中org.apache.ibatis.session.Configuration
-
addMapper
public <T> void addMapper(java.lang.Class<T> type)
使用自己的 MybatisMapperRegistry- 覆盖:
addMapper在类中org.apache.ibatis.session.Configuration
-
addNewMapper
public <T> void addNewMapper(java.lang.Class<T> type)
新增注入新的 Mapper 信息,新增前会清理之前的缓存信息- 类型参数:
T-- 参数:
type- Mapper Type
-
removeMapper
public <T> void removeMapper(java.lang.Class<T> type)
移除 Mapper 相关缓存,支持 GroovyClassLoader 动态注入 Mapper- 类型参数:
T-- 参数:
type- Mapper Type
-
addMappers
public void addMappers(java.lang.String packageName, java.lang.Class<?> superType)使用自己的 MybatisMapperRegistry- 覆盖:
addMappers在类中org.apache.ibatis.session.Configuration
-
addMappers
public void addMappers(java.lang.String packageName)
使用自己的 MybatisMapperRegistry- 覆盖:
addMappers在类中org.apache.ibatis.session.Configuration
-
getMapper
public <T> T getMapper(java.lang.Class<T> type, org.apache.ibatis.session.SqlSession sqlSession)使用自己的 MybatisMapperRegistry- 覆盖:
getMapper在类中org.apache.ibatis.session.Configuration
-
hasMapper
public boolean hasMapper(java.lang.Class<?> type)
使用自己的 MybatisMapperRegistry- 覆盖:
hasMapper在类中org.apache.ibatis.session.Configuration
-
setDefaultScriptingLanguage
public void setDefaultScriptingLanguage(java.lang.Class<? extends org.apache.ibatis.scripting.LanguageDriver> driver)
指定动态SQL生成的默认语言- 覆盖:
setDefaultScriptingLanguage在类中org.apache.ibatis.session.Configuration- 参数:
driver- LanguageDriver
-
addKeyGenerator
public void addKeyGenerator(java.lang.String id, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator)- 覆盖:
addKeyGenerator在类中org.apache.ibatis.session.Configuration
-
getKeyGeneratorNames
public java.util.Collection<java.lang.String> getKeyGeneratorNames()
- 覆盖:
getKeyGeneratorNames在类中org.apache.ibatis.session.Configuration
-
getKeyGenerators
public java.util.Collection<org.apache.ibatis.executor.keygen.KeyGenerator> getKeyGenerators()
- 覆盖:
getKeyGenerators在类中org.apache.ibatis.session.Configuration
-
getKeyGenerator
public org.apache.ibatis.executor.keygen.KeyGenerator getKeyGenerator(java.lang.String id)
- 覆盖:
getKeyGenerator在类中org.apache.ibatis.session.Configuration
-
hasKeyGenerator
public boolean hasKeyGenerator(java.lang.String id)
- 覆盖:
hasKeyGenerator在类中org.apache.ibatis.session.Configuration
-
addCache
public void addCache(org.apache.ibatis.cache.Cache cache)
- 覆盖:
addCache在类中org.apache.ibatis.session.Configuration
-
getCacheNames
public java.util.Collection<java.lang.String> getCacheNames()
- 覆盖:
getCacheNames在类中org.apache.ibatis.session.Configuration
-
getCaches
public java.util.Collection<org.apache.ibatis.cache.Cache> getCaches()
- 覆盖:
getCaches在类中org.apache.ibatis.session.Configuration
-
getCache
public org.apache.ibatis.cache.Cache getCache(java.lang.String id)
- 覆盖:
getCache在类中org.apache.ibatis.session.Configuration
-
hasCache
public boolean hasCache(java.lang.String id)
- 覆盖:
hasCache在类中org.apache.ibatis.session.Configuration
-
addResultMap
public void addResultMap(org.apache.ibatis.mapping.ResultMap rm)
- 覆盖:
addResultMap在类中org.apache.ibatis.session.Configuration
-
getResultMapNames
public java.util.Collection<java.lang.String> getResultMapNames()
- 覆盖:
getResultMapNames在类中org.apache.ibatis.session.Configuration
-
getResultMaps
public java.util.Collection<org.apache.ibatis.mapping.ResultMap> getResultMaps()
- 覆盖:
getResultMaps在类中org.apache.ibatis.session.Configuration
-
getResultMap
public org.apache.ibatis.mapping.ResultMap getResultMap(java.lang.String id)
- 覆盖:
getResultMap在类中org.apache.ibatis.session.Configuration
-
hasResultMap
public boolean hasResultMap(java.lang.String id)
- 覆盖:
hasResultMap在类中org.apache.ibatis.session.Configuration
-
addParameterMap
public void addParameterMap(org.apache.ibatis.mapping.ParameterMap pm)
- 覆盖:
addParameterMap在类中org.apache.ibatis.session.Configuration
-
getParameterMapNames
public java.util.Collection<java.lang.String> getParameterMapNames()
- 覆盖:
getParameterMapNames在类中org.apache.ibatis.session.Configuration
-
getParameterMaps
public java.util.Collection<org.apache.ibatis.mapping.ParameterMap> getParameterMaps()
- 覆盖:
getParameterMaps在类中org.apache.ibatis.session.Configuration
-
getParameterMap
public org.apache.ibatis.mapping.ParameterMap getParameterMap(java.lang.String id)
- 覆盖:
getParameterMap在类中org.apache.ibatis.session.Configuration
-
hasParameterMap
public boolean hasParameterMap(java.lang.String id)
- 覆盖:
hasParameterMap在类中org.apache.ibatis.session.Configuration
-
getSqlFragments
public java.util.Map<java.lang.String,org.apache.ibatis.parsing.XNode> getSqlFragments()
- 覆盖:
getSqlFragments在类中org.apache.ibatis.session.Configuration
-
getMappedStatementNames
public java.util.Collection<java.lang.String> getMappedStatementNames()
- 覆盖:
getMappedStatementNames在类中org.apache.ibatis.session.Configuration
-
getMappedStatements
public java.util.Collection<org.apache.ibatis.mapping.MappedStatement> getMappedStatements()
- 覆盖:
getMappedStatements在类中org.apache.ibatis.session.Configuration
-
getMappedStatement
public org.apache.ibatis.mapping.MappedStatement getMappedStatement(java.lang.String id)
- 覆盖:
getMappedStatement在类中org.apache.ibatis.session.Configuration
-
getMappedStatement
public org.apache.ibatis.mapping.MappedStatement getMappedStatement(java.lang.String id, boolean validateIncompleteStatements)- 覆盖:
getMappedStatement在类中org.apache.ibatis.session.Configuration
-
hasStatement
public boolean hasStatement(java.lang.String statementName, boolean validateIncompleteStatements)- 覆盖:
hasStatement在类中org.apache.ibatis.session.Configuration
-
newExecutor
public org.apache.ibatis.executor.Executor newExecutor(org.apache.ibatis.transaction.Transaction transaction, org.apache.ibatis.session.ExecutorType executorType)- 覆盖:
newExecutor在类中org.apache.ibatis.session.Configuration
-
checkGloballyForDiscriminatedNestedResultMaps
protected void checkGloballyForDiscriminatedNestedResultMaps(org.apache.ibatis.mapping.ResultMap rm)
- 覆盖:
checkGloballyForDiscriminatedNestedResultMaps在类中org.apache.ibatis.session.Configuration
-
checkLocallyForDiscriminatedNestedResultMaps
protected void checkLocallyForDiscriminatedNestedResultMaps(org.apache.ibatis.mapping.ResultMap rm)
- 覆盖:
checkLocallyForDiscriminatedNestedResultMaps在类中org.apache.ibatis.session.Configuration
-
setUseGeneratedShortKey
public void setUseGeneratedShortKey(boolean useGeneratedShortKey)
是否生成短key缓存- 从以下版本开始:
- 3.4.0
-
isUseGeneratedShortKey
public boolean isUseGeneratedShortKey()
是否生成短key缓存- 从以下版本开始:
- 3.4.0
-
-