Bladeren bron

Revert "解决GlobalConfig在ConfigurationCustomizer不生效的问题."

This reverts commit 95f18bfc
nieqiuqiu 5 jaren geleden
bovenliggende
commit
e88992da69

+ 1 - 1
mybatis-plus-boot-starter/src/main/java/com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.java

@@ -198,7 +198,7 @@ public class MybatisPlusAutoConfiguration implements InitializingBean {
             factory.setTypeEnumsPackage(this.properties.getTypeEnumsPackage());
         }
         // TODO 此处必为非 NULL
-        GlobalConfig globalConfig = Optional.ofNullable(this.properties.getGlobalConfig()).orElse(factory.getConfiguration().getGlobalConfig());
+        GlobalConfig globalConfig = this.properties.getGlobalConfig();
         // TODO 注入填充器
         if (this.applicationContext.getBeanNamesForType(MetaObjectHandler.class,
             false, false).length > 0) {

+ 1 - 8
mybatis-plus-boot-starter/src/main/java/com/baomidou/mybatisplus/autoconfigure/MybatisPlusProperties.java

@@ -114,14 +114,7 @@ public class MybatisPlusProperties {
      * TODO 全局配置
      */
     @NestedConfigurationProperty
-    private GlobalConfig globalConfig;
-
-    public GlobalConfig getGlobalConfig() {
-        if (globalConfig == null) {
-            globalConfig = GlobalConfigUtils.defaults();
-        }
-        return globalConfig;
-    }
+    private GlobalConfig globalConfig = GlobalConfigUtils.defaults();
 
 
     public Resource[] resolveMapperLocations() {

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

@@ -323,10 +323,6 @@ public class MybatisSqlSessionFactoryBean implements FactoryBean<SqlSessionFacto
         this.configuration = configuration;
     }
 
-    public MybatisConfiguration getConfiguration(){
-        return this.configuration;
-    }
-
     /**
      * Set locations of MyBatis mapper files that are going to be merged into the {@code SqlSessionFactory} configuration
      * at runtime.