类 MybatisConfiguration

java.lang.Object
org.apache.ibatis.session.Configuration
com.baomidou.mybatisplus.core.MybatisConfiguration

public class MybatisConfiguration extends org.apache.ibatis.session.Configuration
replace default Configuration class

Caratacus 2016/9/25 replace mapperRegistry

从以下版本开始:
2016-01-23
作者:
hubin
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    protected class 
     
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final Map<String,org.apache.ibatis.cache.Cache>
     
    protected final Map<String,org.apache.ibatis.executor.keygen.KeyGenerator>
     
    protected final Map<String,org.apache.ibatis.mapping.MappedStatement>
     
    protected final MybatisMapperRegistry
    Mapper 注册
    protected final Map<String,org.apache.ibatis.mapping.ParameterMap>
     
    protected final Map<String,org.apache.ibatis.mapping.ResultMap>
     
    protected final Map<String,org.apache.ibatis.parsing.XNode>
     

    从类继承的字段 org.apache.ibatis.session.Configuration

    aggressiveLazyLoading, argNameBasedConstructorAutoMapping, 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, nullableOnForEach, objectFactory, objectWrapperFactory, proxyFactory, reflectorFactory, returnInstanceForEmptyRow, safeResultHandlerEnabled, safeRowBoundsEnabled, shrinkWhitespacesInSql, typeAliasRegistry, typeHandlerRegistry, useActualParamName, useColumnLabel, useGeneratedKeys, variables, vfsImpl
  • 构造器概要

    构造器
    构造器
    说明
    初始化调用
    MybatisConfiguration(org.apache.ibatis.mapping.Environment environment)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    addCache(org.apache.ibatis.cache.Cache cache)
     
    void
    addKeyGenerator(String id, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator)
     
    void
    addMappedStatement(org.apache.ibatis.mapping.MappedStatement ms)
    MybatisPlus 加载 SQL 顺序:
    <T> void
    addMapper(Class<T> type)
    使用自己的 MybatisMapperRegistry
    void
    addMappers(String packageName)
    使用自己的 MybatisMapperRegistry
    void
    addMappers(String packageName, Class<?> superType)
    使用自己的 MybatisMapperRegistry
    <T> void
    已过时。
    3.5.8 不建议在实际生产环境中使用.
    void
    addParameterMap(org.apache.ibatis.mapping.ParameterMap pm)
     
    void
    addResultMap(org.apache.ibatis.mapping.ResultMap rm)
     
    void
    checkGloballyForDiscriminatedNestedResultMaps(org.apache.ibatis.mapping.ResultMap rm)
     
    protected void
    checkLocallyForDiscriminatedNestedResultMaps(org.apache.ibatis.mapping.ResultMap rm)
     
    org.apache.ibatis.cache.Cache
     
     
    Collection<org.apache.ibatis.cache.Cache>
     
    org.apache.ibatis.executor.keygen.KeyGenerator
     
     
    Collection<org.apache.ibatis.executor.keygen.KeyGenerator>
     
    org.apache.ibatis.mapping.MappedStatement
     
    org.apache.ibatis.mapping.MappedStatement
    getMappedStatement(String id, boolean validateIncompleteStatements)
     
     
    Collection<org.apache.ibatis.mapping.MappedStatement>
     
    <T> T
    getMapper(Class<T> type, org.apache.ibatis.session.SqlSession sqlSession)
    使用自己的 MybatisMapperRegistry
    org.apache.ibatis.binding.MapperRegistry
    使用自己的 MybatisMapperRegistry
    org.apache.ibatis.mapping.ParameterMap
     
     
    Collection<org.apache.ibatis.mapping.ParameterMap>
     
    org.apache.ibatis.mapping.ResultMap
     
     
    Collection<org.apache.ibatis.mapping.ResultMap>
     
    Map<String,org.apache.ibatis.parsing.XNode>
     
    boolean
     
    boolean
     
    boolean
    hasMapper(Class<?> type)
    使用自己的 MybatisMapperRegistry
    boolean
     
    boolean
     
    boolean
    hasStatement(String statementName, boolean validateIncompleteStatements)
     
    boolean
    是否生成短key缓存
    org.apache.ibatis.executor.Executor
    newExecutor(org.apache.ibatis.transaction.Transaction transaction, org.apache.ibatis.session.ExecutorType executorType)
     
    <T> void
    已过时。
    3.5.8 不建议在实际生产环境中使用.
    void
    setDefaultEnumTypeHandler(Class<? extends org.apache.ibatis.type.TypeHandler> typeHandler)
     
    void
    setDefaultScriptingLanguage(Class<? extends org.apache.ibatis.scripting.LanguageDriver> driver)
    指定动态SQL生成的默认语言
    void
    setUseGeneratedShortKey(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, isArgNameBasedConstructorAutoMapping, isCacheEnabled, isCallSettersOnNulls, isLazyLoadingEnabled, isMapUnderscoreToCamelCase, isMultipleResultSetsEnabled, isNullableOnForEach, isResourceLoaded, isReturnInstanceForEmptyRow, isSafeResultHandlerEnabled, isSafeRowBoundsEnabled, isShrinkWhitespacesInSql, isUseActualParamName, isUseColumnLabel, isUseGeneratedKeys, newExecutor, newMetaObject, newParameterHandler, newResultSetHandler, newStatementHandler, parsePendingCacheRefs, parsePendingMethods, parsePendingResultMaps, parsePendingStatements, setAggressiveLazyLoading, setArgNameBasedConstructorAutoMapping, setAutoMappingBehavior, setAutoMappingUnknownColumnBehavior, setCacheEnabled, setCallSettersOnNulls, setConfigurationFactory, setDatabaseId, 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

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • mybatisMapperRegistry

      protected final MybatisMapperRegistry mybatisMapperRegistry
      Mapper 注册
    • caches

      protected final Map<String,org.apache.ibatis.cache.Cache> caches
    • resultMaps

      protected final Map<String,org.apache.ibatis.mapping.ResultMap> resultMaps
    • parameterMaps

      protected final Map<String,org.apache.ibatis.mapping.ParameterMap> parameterMaps
    • keyGenerators

      protected final Map<String,org.apache.ibatis.executor.keygen.KeyGenerator> keyGenerators
    • sqlFragments

      protected final Map<String,org.apache.ibatis.parsing.XNode> sqlFragments
    • mappedStatements

      protected final Map<String,org.apache.ibatis.mapping.MappedStatement> mappedStatements
  • 构造器详细资料

    • MybatisConfiguration

      public MybatisConfiguration(org.apache.ibatis.mapping.Environment environment)
    • MybatisConfiguration

      public MybatisConfiguration()
      初始化调用
  • 方法详细资料

    • 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(Class<T> type)
      使用自己的 MybatisMapperRegistry
      覆盖:
      addMapper 在类中 org.apache.ibatis.session.Configuration
    • addNewMapper

      @Deprecated public <T> void addNewMapper(Class<T> type)
      已过时。
      3.5.8 不建议在实际生产环境中使用.
      新增注入新的 Mapper 信息,新增前会清理之前的缓存信息
      参数:
      type - Mapper Type
    • removeMapper

      @Deprecated public <T> void removeMapper(Class<T> type)
      已过时。
      3.5.8 不建议在实际生产环境中使用.
      移除 Mapper 相关缓存,支持 GroovyClassLoader 动态注入 Mapper
      参数:
      type - Mapper Type
    • addMappers

      public void addMappers(String packageName, Class<?> superType)
      使用自己的 MybatisMapperRegistry
      覆盖:
      addMappers 在类中 org.apache.ibatis.session.Configuration
    • addMappers

      public void addMappers(String packageName)
      使用自己的 MybatisMapperRegistry
      覆盖:
      addMappers 在类中 org.apache.ibatis.session.Configuration
    • getMapper

      public <T> T getMapper(Class<T> type, org.apache.ibatis.session.SqlSession sqlSession)
      使用自己的 MybatisMapperRegistry
      覆盖:
      getMapper 在类中 org.apache.ibatis.session.Configuration
    • hasMapper

      public boolean hasMapper(Class<?> type)
      使用自己的 MybatisMapperRegistry
      覆盖:
      hasMapper 在类中 org.apache.ibatis.session.Configuration
    • setDefaultScriptingLanguage

      public void setDefaultScriptingLanguage(Class<? extends org.apache.ibatis.scripting.LanguageDriver> driver)
      指定动态SQL生成的默认语言
      覆盖:
      setDefaultScriptingLanguage 在类中 org.apache.ibatis.session.Configuration
      参数:
      driver - LanguageDriver
    • setDefaultEnumTypeHandler

      public void setDefaultEnumTypeHandler(Class<? extends org.apache.ibatis.type.TypeHandler> typeHandler)
      覆盖:
      setDefaultEnumTypeHandler 在类中 org.apache.ibatis.session.Configuration
    • addKeyGenerator

      public void addKeyGenerator(String id, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator)
      覆盖:
      addKeyGenerator 在类中 org.apache.ibatis.session.Configuration
    • getKeyGeneratorNames

      public Collection<String> getKeyGeneratorNames()
      覆盖:
      getKeyGeneratorNames 在类中 org.apache.ibatis.session.Configuration
    • getKeyGenerators

      public Collection<org.apache.ibatis.executor.keygen.KeyGenerator> getKeyGenerators()
      覆盖:
      getKeyGenerators 在类中 org.apache.ibatis.session.Configuration
    • getKeyGenerator

      public org.apache.ibatis.executor.keygen.KeyGenerator getKeyGenerator(String id)
      覆盖:
      getKeyGenerator 在类中 org.apache.ibatis.session.Configuration
    • hasKeyGenerator

      public boolean hasKeyGenerator(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 Collection<String> getCacheNames()
      覆盖:
      getCacheNames 在类中 org.apache.ibatis.session.Configuration
    • getCaches

      public Collection<org.apache.ibatis.cache.Cache> getCaches()
      覆盖:
      getCaches 在类中 org.apache.ibatis.session.Configuration
    • getCache

      public org.apache.ibatis.cache.Cache getCache(String id)
      覆盖:
      getCache 在类中 org.apache.ibatis.session.Configuration
    • hasCache

      public boolean hasCache(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 Collection<String> getResultMapNames()
      覆盖:
      getResultMapNames 在类中 org.apache.ibatis.session.Configuration
    • getResultMaps

      public Collection<org.apache.ibatis.mapping.ResultMap> getResultMaps()
      覆盖:
      getResultMaps 在类中 org.apache.ibatis.session.Configuration
    • getResultMap

      public org.apache.ibatis.mapping.ResultMap getResultMap(String id)
      覆盖:
      getResultMap 在类中 org.apache.ibatis.session.Configuration
    • hasResultMap

      public boolean hasResultMap(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 Collection<String> getParameterMapNames()
      覆盖:
      getParameterMapNames 在类中 org.apache.ibatis.session.Configuration
    • getParameterMaps

      public Collection<org.apache.ibatis.mapping.ParameterMap> getParameterMaps()
      覆盖:
      getParameterMaps 在类中 org.apache.ibatis.session.Configuration
    • getParameterMap

      public org.apache.ibatis.mapping.ParameterMap getParameterMap(String id)
      覆盖:
      getParameterMap 在类中 org.apache.ibatis.session.Configuration
    • hasParameterMap

      public boolean hasParameterMap(String id)
      覆盖:
      hasParameterMap 在类中 org.apache.ibatis.session.Configuration
    • getSqlFragments

      public Map<String,org.apache.ibatis.parsing.XNode> getSqlFragments()
      覆盖:
      getSqlFragments 在类中 org.apache.ibatis.session.Configuration
    • getMappedStatementNames

      public Collection<String> getMappedStatementNames()
      覆盖:
      getMappedStatementNames 在类中 org.apache.ibatis.session.Configuration
    • getMappedStatements

      public Collection<org.apache.ibatis.mapping.MappedStatement> getMappedStatements()
      覆盖:
      getMappedStatements 在类中 org.apache.ibatis.session.Configuration
    • getMappedStatement

      public org.apache.ibatis.mapping.MappedStatement getMappedStatement(String id)
      覆盖:
      getMappedStatement 在类中 org.apache.ibatis.session.Configuration
    • getMappedStatement

      public org.apache.ibatis.mapping.MappedStatement getMappedStatement(String id, boolean validateIncompleteStatements)
      覆盖:
      getMappedStatement 在类中 org.apache.ibatis.session.Configuration
    • hasStatement

      public boolean hasStatement(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

      public 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