瀏覽代碼

清理热加载相关.

nieqiurong 6 年之前
父節點
當前提交
6ac6683afe

+ 4 - 12
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisConfiguration.java

@@ -23,7 +23,6 @@ import org.apache.ibatis.session.Configuration;
 import org.apache.ibatis.session.SqlSession;
 
 import com.baomidou.mybatisplus.core.config.GlobalConfig;
-import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 
 /**
@@ -86,19 +85,12 @@ public class MybatisConfiguration extends Configuration {
     @Override
     public void addMappedStatement(MappedStatement ms) {
         logger.debug("addMappedStatement: " + ms.getId());
-        if (GlobalConfigUtils.isRefresh(ms.getConfiguration())) {
+        if (mappedStatements.containsKey(ms.getId())) {
             /*
-             * 支持是否自动刷新 XML 变更内容,开发环境使用【 注:生产环境勿用!】
+             * 说明已加载了xml中的节点; 忽略mapper中的SqlProvider数据
              */
-            mappedStatements.remove(ms.getId());
-        } else {
-            if (mappedStatements.containsKey(ms.getId())) {
-                /*
-                 * 说明已加载了xml中的节点; 忽略mapper中的SqlProvider数据
-                 */
-                logger.error("mapper[" + ms.getId() + "] is ignored, because it exists, maybe from xml file");
-                return;
-            }
+            logger.error("mapper[" + ms.getId() + "] is ignored, because it exists, maybe from xml file");
+            return;
         }
         super.addMappedStatement(ms);
     }

+ 0 - 4
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/config/GlobalConfig.java

@@ -52,10 +52,6 @@ public class GlobalConfig implements Serializable {
      * 是否开启 LOGO
      */
     private boolean banner = true;
-    /**
-     * 是否刷新 mapper
-     */
-    private boolean refresh = false;
     /**
      * 缓存 Sql 解析初始化
      */

+ 0 - 4
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/GlobalConfigUtils.java

@@ -160,10 +160,6 @@ public class GlobalConfigUtils {
         return getGlobalConfig(configuration).getSuperMapperClass();
     }
 
-    public static boolean isRefresh(Configuration configuration) {
-        return getGlobalConfig(configuration).isRefresh();
-    }
-
     public static Set<String> getMapperRegistryCache(Configuration configuration) {
         return getGlobalConfig(configuration).getMapperRegistryCache();
     }

+ 0 - 5
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/spring/MybatisSqlSessionFactoryBean.java

@@ -623,11 +623,6 @@ public class MybatisSqlSessionFactoryBean implements FactoryBean<SqlSessionFacto
         globalConfig.signGlobalConfig(sqlSessionFactory);
 
         if (!isEmpty(this.mapperLocations)) {
-            if (globalConfig.isRefresh()) {
-                //TODO 设置自动刷新配置 减少配置
-                new MybatisMapperRefresh(this.mapperLocations, sqlSessionFactory, 2,
-                    2, true);
-            }
             for (Resource mapperLocation : this.mapperLocations) {
                 if (mapperLocation == null) {
                     continue;