Pārlūkot izejas kodu

feat: 删除过时的代码

小锅盖 4 gadi atpakaļ
vecāks
revīzija
3dc9f9752c
39 mainītis faili ar 98 papildinājumiem un 1775 dzēšanām
  1. 1 16
      mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/IdType.java
  2. 0 7
      mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/KeySequence.java
  3. 0 37
      mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/SqlParser.java
  4. 0 49
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisConfiguration.java
  5. 0 32
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisDefaultParameterHandler.java
  6. 0 2
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisMapperAnnotationBuilder.java
  7. 0 2
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisXMLConfigBuilder.java
  8. 1 1
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisXMLLanguageDriver.java
  9. 0 29
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/enums/IEnum.java
  10. 0 87
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/AbstractBaseExecutor.java
  11. 0 175
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisBatchExecutor.java
  12. 0 280
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisCachingExecutor.java
  13. 0 120
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisReuseExecutor.java
  14. 0 103
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisSimpleExecutor.java
  15. 12 24
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/handlers/MybatisEnumTypeHandler.java
  16. 0 60
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/metadata/IPage.java
  17. 0 48
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/metadata/PageList.java
  18. 1 9
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/override/MybatisMapperMethod.java
  19. 0 116
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/parser/SqlParserHelper.java
  20. 0 67
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/EnumUtils.java
  21. 14 60
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/ReflectionKit.java
  22. 3 9
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/support/SerializedLambda.java
  23. 3 5
      mybatis-plus-core/src/test/java/com/baomidou/mybatisplus/core/conditions/UpdateWrapperTest.java
  24. 0 88
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/handlers/AbstractSqlParserHandler.java
  25. 0 69
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/handlers/MybatisEnumTypeHandler.java
  26. 1 3
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/IllegalSQLInnerInterceptor.java
  27. 0 3
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/TenantLineInnerInterceptor.java
  28. 0 84
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/pagination/Page.java
  29. 0 17
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/SqlHelper.java
  30. 0 30
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/SqlParserUtils.java
  31. 0 69
      mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/VersionUtils.java
  32. 56 56
      mybatis-plus-extension/src/test/java/com/baomidou/mybatisplus/test/handlers/MybatisEnumTypeHandlerTest.java
  33. 0 1
      mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/BaseDbTest.java
  34. 4 7
      mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/PageTest.java
  35. 0 1
      mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/cache/CacheConfig.java
  36. 1 1
      mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/idgenerator/model/StringIdGeneratorModel.java
  37. 0 4
      mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/mapper/commons/CommonDataMapper.java
  38. 0 3
      mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/mapper/commons/ResultMapEntityMapper.java
  39. 1 1
      mybatis-plus/src/test/resources/mybatis-config.xml

+ 1 - 16
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/IdType.java

@@ -52,22 +52,7 @@ public enum IdType {
      * 分配UUID (主键类型为 string)
      * 分配UUID (主键类型为 string)
      * 默认实现类 {@link com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator}(UUID.replace("-",""))
      * 默认实现类 {@link com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator}(UUID.replace("-",""))
      */
      */
-    ASSIGN_UUID(4),
-    /**
-     * @deprecated 3.3.0 please use {@link #ASSIGN_ID}
-     */
-    @Deprecated
-    ID_WORKER(3),
-    /**
-     * @deprecated 3.3.0 please use {@link #ASSIGN_ID}
-     */
-    @Deprecated
-    ID_WORKER_STR(3),
-    /**
-     * @deprecated 3.3.0 please use {@link #ASSIGN_UUID}
-     */
-    @Deprecated
-    UUID(4);
+    ASSIGN_UUID(4);
 
 
     private final int key;
     private final int key;
 
 

+ 0 - 7
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/KeySequence.java

@@ -34,11 +34,4 @@ public @interface KeySequence {
      * 序列名
      * 序列名
      */
      */
     String value() default "";
     String value() default "";
-
-    /**
-     * id的类型
-     * @deprecated 3.1.2 自动匹配,无需指定
-     */
-    @Deprecated
-    Class<?> clazz() default Long.class;
 }
 }

+ 0 - 37
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/SqlParser.java

@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.annotation;
-
-import java.lang.annotation.*;
-
-/**
- * 租户注解
- *
- * @author hubin
- * @since 2018-01-13
- * @deprecated 3.4.0 use {@link InterceptorIgnore}
- */
-@Documented
-@Deprecated
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface SqlParser {
-
-    /**
-     * 过滤 SQL 解析,默认 false
-     */
-    boolean filter() default false;
-}

+ 0 - 49
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisConfiguration.java

@@ -15,12 +15,6 @@
  */
  */
 package com.baomidou.mybatisplus.core;
 package com.baomidou.mybatisplus.core;
 
 
-import com.baomidou.mybatisplus.core.config.GlobalConfig;
-import com.baomidou.mybatisplus.core.executor.MybatisBatchExecutor;
-import com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor;
-import com.baomidou.mybatisplus.core.executor.MybatisReuseExecutor;
-import com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor;
-import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 import org.apache.ibatis.binding.MapperRegistry;
 import org.apache.ibatis.binding.MapperRegistry;
@@ -76,37 +70,11 @@ public class MybatisConfiguration extends Configuration {
     @Getter
     @Getter
     private boolean useGeneratedShortKey = true;
     private boolean useGeneratedShortKey = true;
 
 
-    /**
-     * @deprecated 该属性将会随着 com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor 插件的移除而移除
-     */
-    @Deprecated
-    @Setter
-    @Getter
-    private boolean useDeprecatedExecutor = true;
-
     public MybatisConfiguration(Environment environment) {
     public MybatisConfiguration(Environment environment) {
         this();
         this();
         this.environment = environment;
         this.environment = environment;
     }
     }
 
 
-    /**
-     * @return GlobalConfig
-     * @deprecated 3.4.0 please use {@link GlobalConfigUtils#getGlobalConfig(Configuration)}
-     */
-    @Deprecated
-    public GlobalConfig getGlobalConfig() {
-        return GlobalConfigUtils.getGlobalConfig(this);
-    }
-
-    /**
-     * @param globalConfig GlobalConfig
-     * @deprecated 3.4.0 please use {@link GlobalConfigUtils#setGlobalConfig(Configuration, GlobalConfig)}
-     */
-    @Deprecated
-    public void setGlobalConfig(GlobalConfig globalConfig) {
-        GlobalConfigUtils.setGlobalConfig(this, globalConfig);
-    }
-
     /**
     /**
      * 初始化调用
      * 初始化调用
      */
      */
@@ -340,23 +308,6 @@ public class MybatisConfiguration extends Configuration {
 
 
     @Override
     @Override
     public Executor newExecutor(Transaction transaction, ExecutorType executorType) {
     public Executor newExecutor(Transaction transaction, ExecutorType executorType) {
-        if (useDeprecatedExecutor) {
-            executorType = executorType == null ? defaultExecutorType : executorType;
-            executorType = executorType == null ? ExecutorType.SIMPLE : executorType;
-            Executor executor;
-            if (ExecutorType.BATCH == executorType) {
-                executor = new MybatisBatchExecutor(this, transaction);
-            } else if (ExecutorType.REUSE == executorType) {
-                executor = new MybatisReuseExecutor(this, transaction);
-            } else {
-                executor = new MybatisSimpleExecutor(this, transaction);
-            }
-            if (cacheEnabled) {
-                executor = new MybatisCachingExecutor(executor);
-            }
-            executor = (Executor) interceptorChain.pluginAll(executor);
-            return executor;
-        }
         return super.newExecutor(transaction, executorType);
         return super.newExecutor(transaction, executorType);
     }
     }
 
 

+ 0 - 32
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisDefaultParameterHandler.java

@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core;
-
-import org.apache.ibatis.mapping.BoundSql;
-import org.apache.ibatis.mapping.MappedStatement;
-
-/**
- * @author miemie
- * @since 2020-06-09
- * @deprecated see {@link MybatisParameterHandler}
- */
-@Deprecated
-public class MybatisDefaultParameterHandler extends MybatisParameterHandler {
-
-    public MybatisDefaultParameterHandler(MappedStatement mappedStatement, Object parameter, BoundSql boundSql) {
-        super(mappedStatement, parameter, boundSql);
-    }
-}

+ 0 - 2
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisMapperAnnotationBuilder.java

@@ -16,7 +16,6 @@
 package com.baomidou.mybatisplus.core;
 package com.baomidou.mybatisplus.core;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
 import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
 import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
 import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
 import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
 import lombok.Getter;
 import lombok.Getter;
@@ -109,7 +108,6 @@ public class MybatisMapperAnnotationBuilder extends MapperAnnotationBuilder {
                 try {
                 try {
                     // TODO 加入 注解过滤缓存
                     // TODO 加入 注解过滤缓存
                     InterceptorIgnoreHelper.initSqlParserInfoCache(cache, mapperName, method);
                     InterceptorIgnoreHelper.initSqlParserInfoCache(cache, mapperName, method);
-                    SqlParserHelper.initSqlParserInfoCache(mapperName, method);
                     parseStatement(method);
                     parseStatement(method);
                 } catch (IncompleteElementException e) {
                 } catch (IncompleteElementException e) {
                     // TODO 使用 MybatisMethodResolver 而不是 MethodResolver
                     // TODO 使用 MybatisMethodResolver 而不是 MethodResolver

+ 0 - 2
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisXMLConfigBuilder.java

@@ -271,8 +271,6 @@ public class MybatisXMLConfigBuilder extends BaseBuilder {
         configuration.setLogPrefix(props.getProperty("logPrefix"));
         configuration.setLogPrefix(props.getProperty("logPrefix"));
         configuration.setConfigurationFactory(resolveClass(props.getProperty("configurationFactory")));
         configuration.setConfigurationFactory(resolveClass(props.getProperty("configurationFactory")));
         configuration.setShrinkWhitespacesInSql(booleanValueOf(props.getProperty("shrinkWhitespacesInSql"), false));
         configuration.setShrinkWhitespacesInSql(booleanValueOf(props.getProperty("shrinkWhitespacesInSql"), false));
-        // TODO MybatisConfiguration 独有的属性
-        ((MybatisConfiguration) configuration).setUseDeprecatedExecutor(booleanValueOf(props.getProperty("useNewExecutor"), true));
         ((MybatisConfiguration) configuration).setUseGeneratedShortKey(booleanValueOf(props.getProperty("useGeneratedShortKey"), true));
         ((MybatisConfiguration) configuration).setUseGeneratedShortKey(booleanValueOf(props.getProperty("useGeneratedShortKey"), true));
     }
     }
 
 

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisXMLLanguageDriver.java

@@ -41,7 +41,7 @@ public class MybatisXMLLanguageDriver extends XMLLanguageDriver {
     @Override
     @Override
     public ParameterHandler createParameterHandler(MappedStatement mappedStatement,
     public ParameterHandler createParameterHandler(MappedStatement mappedStatement,
                                                    Object parameterObject, BoundSql boundSql) {
                                                    Object parameterObject, BoundSql boundSql) {
-        // TODO 使用 MybatisParameterHandler 而不是 ParameterHandler
+        // 使用 MybatisParameterHandler 而不是 ParameterHandler
         return new MybatisParameterHandler(mappedStatement, parameterObject, boundSql);
         return new MybatisParameterHandler(mappedStatement, parameterObject, boundSql);
     }
     }
 
 

+ 0 - 29
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/enums/IEnum.java

@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.enums;
-
-import java.io.Serializable;
-
-/**
- * 自定义枚举接口
- *
- * @author hubin
- * @since 2017-10-11
- * @deprecated 3.4.0
- */
-@Deprecated
-public interface IEnum<T extends Serializable> extends com.baomidou.mybatisplus.annotation.IEnum<T> {
-}

+ 0 - 87
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/AbstractBaseExecutor.java

@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.executor;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.ParameterUtils;
-import org.apache.ibatis.cache.CacheKey;
-import org.apache.ibatis.executor.BaseExecutor;
-import org.apache.ibatis.executor.ExecutorException;
-import org.apache.ibatis.mapping.BoundSql;
-import org.apache.ibatis.mapping.MappedStatement;
-import org.apache.ibatis.mapping.ParameterMapping;
-import org.apache.ibatis.mapping.ParameterMode;
-import org.apache.ibatis.reflection.MetaObject;
-import org.apache.ibatis.session.Configuration;
-import org.apache.ibatis.session.RowBounds;
-import org.apache.ibatis.transaction.Transaction;
-import org.apache.ibatis.type.TypeHandlerRegistry;
-
-import java.util.List;
-import java.util.Optional;
-
-/**
- * 重写执行器 {@link org.apache.ibatis.executor.BaseExecutor}
- *
- * @author nieqiurong 2019/4/22.
- * @deprecated 3.4.0
- */
-@Deprecated
-public abstract class AbstractBaseExecutor extends BaseExecutor {
-
-    protected AbstractBaseExecutor(Configuration configuration, Transaction transaction) {
-        super(configuration, transaction);
-    }
-
-    @Override
-    public CacheKey createCacheKey(MappedStatement ms, Object parameterObject, RowBounds rowBounds, BoundSql boundSql) {
-        if (super.isClosed()) {
-            throw new ExecutorException("Executor was closed.");
-        }
-        CacheKey cacheKey = new CacheKey();
-        cacheKey.update(ms.getId());
-        cacheKey.update(rowBounds.getOffset());
-        cacheKey.update(rowBounds.getLimit());
-        Optional<IPage> pageOptional = ParameterUtils.findPage(parameterObject);
-        pageOptional.ifPresent(page -> cacheKey.update(page.cacheKey()));
-        cacheKey.update(boundSql.getSql());
-        List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
-        TypeHandlerRegistry typeHandlerRegistry = ms.getConfiguration().getTypeHandlerRegistry();
-        // mimic DefaultParameterHandler logic
-        for (ParameterMapping parameterMapping : parameterMappings) {
-            if (parameterMapping.getMode() != ParameterMode.OUT) {
-                Object value;
-                String propertyName = parameterMapping.getProperty();
-                if (boundSql.hasAdditionalParameter(propertyName)) {
-                    value = boundSql.getAdditionalParameter(propertyName);
-                } else if (parameterObject == null) {
-                    value = null;
-                } else if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) {
-                    value = parameterObject;
-                } else {
-                    MetaObject metaObject = configuration.newMetaObject(parameterObject);
-                    value = metaObject.getValue(propertyName);
-                }
-                cacheKey.update(value);
-            }
-        }
-        if (configuration.getEnvironment() != null) {
-            // issue #176
-            cacheKey.update(configuration.getEnvironment().getId());
-        }
-        return cacheKey;
-    }
-}

+ 0 - 175
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisBatchExecutor.java

@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.executor;
-
-import org.apache.ibatis.cursor.Cursor;
-import org.apache.ibatis.executor.BatchExecutorException;
-import org.apache.ibatis.executor.BatchResult;
-import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
-import org.apache.ibatis.executor.keygen.KeyGenerator;
-import org.apache.ibatis.executor.keygen.NoKeyGenerator;
-import org.apache.ibatis.executor.statement.StatementHandler;
-import org.apache.ibatis.mapping.BoundSql;
-import org.apache.ibatis.mapping.MappedStatement;
-import org.apache.ibatis.session.Configuration;
-import org.apache.ibatis.session.ResultHandler;
-import org.apache.ibatis.session.RowBounds;
-import org.apache.ibatis.transaction.Transaction;
-
-import java.sql.BatchUpdateException;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * 重写执行器 {@link org.apache.ibatis.executor.BatchExecutor}
- *
- * @author nieqiurong 2019/4/14.
- * @deprecated 3.4.0
- */
-@Deprecated
-public class MybatisBatchExecutor extends AbstractBaseExecutor {
-    public static final int BATCH_UPDATE_RETURN_VALUE = Integer.MIN_VALUE + 1002;
-
-    private final List<Statement> statementList = new ArrayList<>();
-    private final List<BatchResult> batchResultList = new ArrayList<>();
-    private String currentSql;
-    private MappedStatement currentStatement;
-
-    public MybatisBatchExecutor(Configuration configuration, Transaction transaction) {
-        super(configuration, transaction);
-    }
-
-    @Override
-    public int doUpdate(MappedStatement ms, Object parameterObject) throws SQLException {
-        final Configuration configuration = ms.getConfiguration();
-        final StatementHandler handler = configuration.newStatementHandler(this, ms, parameterObject, RowBounds.DEFAULT, null, null);
-        final BoundSql boundSql = handler.getBoundSql();
-        final String sql = boundSql.getSql();
-        final Statement stmt;
-        if (sql.equals(currentSql) && ms.equals(currentStatement)) {
-            int last = statementList.size() - 1;
-            stmt = statementList.get(last);
-            applyTransactionTimeout(stmt);
-            handler.parameterize(stmt);//fix Issues 322
-            BatchResult batchResult = batchResultList.get(last);
-            batchResult.addParameterObject(parameterObject);
-        } else {
-            Connection connection = getConnection(ms.getStatementLog());
-            stmt = handler.prepare(connection, transaction.getTimeout());
-            if (stmt == null) {
-                return 0;
-            }
-            handler.parameterize(stmt);    //fix Issues 322
-            currentSql = sql;
-            currentStatement = ms;
-            statementList.add(stmt);
-            batchResultList.add(new BatchResult(ms, sql, parameterObject));
-        }
-        handler.batch(stmt);
-        return BATCH_UPDATE_RETURN_VALUE;
-    }
-
-    @Override
-    public <E> List<E> doQuery(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql)
-        throws SQLException {
-        Statement stmt = null;
-        try {
-            flushStatements();
-            Configuration configuration = ms.getConfiguration();
-            StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameterObject, rowBounds, resultHandler, boundSql);
-            Connection connection = getConnection(ms.getStatementLog());
-            stmt = handler.prepare(connection, transaction.getTimeout());
-            if (stmt == null) {
-                return Collections.emptyList();
-            }
-            handler.parameterize(stmt);
-            return handler.query(stmt, resultHandler);
-        } finally {
-            closeStatement(stmt);
-        }
-    }
-
-    @Override
-    protected <E> Cursor<E> doQueryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds, BoundSql boundSql) throws SQLException {
-        flushStatements();
-        Configuration configuration = ms.getConfiguration();
-        StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, null, boundSql);
-        Connection connection = getConnection(ms.getStatementLog());
-        //游标不支持返回null
-        Statement stmt = handler.prepare(connection, transaction.getTimeout());
-        handler.parameterize(stmt);
-        Cursor<E> cursor = handler.queryCursor(stmt);
-        stmt.closeOnCompletion();
-        return cursor;
-    }
-
-    @Override
-    public List<BatchResult> doFlushStatements(boolean isRollback) throws SQLException {
-        try {
-            List<BatchResult> results = new ArrayList<>();
-            if (isRollback) {
-                return Collections.emptyList();
-            }
-            for (int i = 0, n = statementList.size(); i < n; i++) {
-                Statement stmt = statementList.get(i);
-                applyTransactionTimeout(stmt);
-                BatchResult batchResult = batchResultList.get(i);
-                try {
-                    batchResult.setUpdateCounts(stmt.executeBatch());
-                    MappedStatement ms = batchResult.getMappedStatement();
-                    List<Object> parameterObjects = batchResult.getParameterObjects();
-                    KeyGenerator keyGenerator = ms.getKeyGenerator();
-                    if (Jdbc3KeyGenerator.class.equals(keyGenerator.getClass())) {
-                        Jdbc3KeyGenerator jdbc3KeyGenerator = (Jdbc3KeyGenerator) keyGenerator;
-                        jdbc3KeyGenerator.processBatch(ms, stmt, parameterObjects);
-                    } else if (!NoKeyGenerator.class.equals(keyGenerator.getClass())) { //issue #141
-                        for (Object parameter : parameterObjects) {
-                            keyGenerator.processAfter(this, ms, stmt, parameter);
-                        }
-                    }
-                    // Close statement to close cursor #1109
-                    closeStatement(stmt);
-                } catch (BatchUpdateException e) {
-                    StringBuilder message = new StringBuilder();
-                    message.append(batchResult.getMappedStatement().getId())
-                        .append(" (batch index #")
-                        .append(i + 1)
-                        .append(")")
-                        .append(" failed.");
-                    if (i > 0) {
-                        message.append(" ")
-                            .append(i)
-                            .append(" prior sub executor(s) completed successfully, but will be rolled back.");
-                    }
-                    throw new BatchExecutorException(message.toString(), e, results, batchResult);
-                }
-                results.add(batchResult);
-            }
-            return results;
-        } finally {
-            for (Statement stmt : statementList) {
-                closeStatement(stmt);
-            }
-            currentSql = null;
-            statementList.clear();
-            batchResultList.clear();
-        }
-    }
-}

+ 0 - 280
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisCachingExecutor.java

@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.executor;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.metadata.PageList;
-import com.baomidou.mybatisplus.core.toolkit.ParameterUtils;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import org.apache.ibatis.cache.Cache;
-import org.apache.ibatis.cache.CacheKey;
-import org.apache.ibatis.cache.TransactionalCacheManager;
-import org.apache.ibatis.cursor.Cursor;
-import org.apache.ibatis.executor.BatchResult;
-import org.apache.ibatis.executor.Executor;
-import org.apache.ibatis.executor.ExecutorException;
-import org.apache.ibatis.mapping.*;
-import org.apache.ibatis.reflection.MetaObject;
-import org.apache.ibatis.session.Configuration;
-import org.apache.ibatis.session.ResultHandler;
-import org.apache.ibatis.session.RowBounds;
-import org.apache.ibatis.transaction.Transaction;
-import org.apache.ibatis.type.TypeHandlerRegistry;
-
-import java.sql.SQLException;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * copy org.apache.ibatis.executor.CachingExecutor 主要修改了分页缓存逻辑
- *
- * @author nieqiuqiu
- * @deprecated 3.4.0
- */
-@Deprecated
-public class MybatisCachingExecutor implements Executor {
-
-    private final Executor delegate;
-    private final TransactionalCacheManager tcm = new TransactionalCacheManager();
-
-    public MybatisCachingExecutor(Executor delegate) {
-        this.delegate = delegate;
-        delegate.setExecutorWrapper(this);
-    }
-
-    @Override
-    public Transaction getTransaction() {
-        return delegate.getTransaction();
-    }
-
-    @Override
-    public void close(boolean forceRollback) {
-        try {
-            //issues #499, #524 and #573
-            if (forceRollback) {
-                tcm.rollback();
-            } else {
-                tcm.commit();
-            }
-        } finally {
-            delegate.close(forceRollback);
-        }
-    }
-
-    @Override
-    public boolean isClosed() {
-        return delegate.isClosed();
-    }
-
-    @Override
-    public int update(MappedStatement ms, Object parameterObject) throws SQLException {
-        flushCacheIfRequired(ms);
-        return delegate.update(ms, parameterObject);
-    }
-
-    @Override
-    public <E> List<E> query(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException {
-        BoundSql boundSql = ms.getBoundSql(parameterObject);
-        CacheKey key = createCacheKey(ms, parameterObject, rowBounds, boundSql);
-        return query(ms, parameterObject, rowBounds, resultHandler, key, boundSql);
-    }
-
-    @Override
-    public <E> Cursor<E> queryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds) throws SQLException {
-        flushCacheIfRequired(ms);
-        return delegate.queryCursor(ms, parameter, rowBounds);
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public <E> List<E> query(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql)
-        throws SQLException {
-        Cache cache = ms.getCache();
-        Optional<IPage> pageOptional = ParameterUtils.findPage(parameterObject);
-        if (cache != null) {
-            flushCacheIfRequired(ms);
-            if (ms.isUseCache() && resultHandler == null) {
-                ensureNoOutParams(ms, boundSql);
-                Object result = tcm.getObject(cache, key);
-                if (result == null) {
-                    if (pageOptional.isPresent()) {
-                        IPage page = pageOptional.get();
-                        CacheKey countCacheKey = null;
-                        if (page.isSearchCount()) {
-                            // 这里的执行sql为原select语句,标准一点的是需要将此转换为count语句当做缓存key的,留做当优化把.
-                            countCacheKey = getCountCacheKey(ms, boundSql, parameterObject, RowBounds.DEFAULT);
-                            // 复用count结果缓存,减少count查询.
-                            Number count = (Number) tcm.getObject(cache, countCacheKey);
-                            if (count != null) {
-                                page.hitCount(true);
-                                page.setTotal(count.longValue());
-                            }
-                        }
-                        // 切勿将这提取至上方,如果先查的话,需要提前将boundSql拷贝一份
-                        result = delegate.query(ms, parameterObject, rowBounds, resultHandler, key, boundSql);
-                        List<E> records = (List<E>) result;
-                        page.setRecords(records);
-                        tcm.putObject(cache, key, records);
-                        if (countCacheKey != null && !page.isHitCount()) {
-                            tcm.putObject(cache, countCacheKey, page.getTotal());
-                        }
-                        return new PageList(records, page.getTotal());
-                    } else {
-                        result = delegate.query(ms, parameterObject, rowBounds, resultHandler, key, boundSql);
-                        // issue #578 and #116
-                        tcm.putObject(cache, key, result);
-                        return (List<E>) result;
-                    }
-                } else {
-                    if (pageOptional.isPresent()) {
-                        IPage page = pageOptional.get();
-                        if (page.isSearchCount()) {
-                            CacheKey cacheKey = getCountCacheKey(ms, boundSql, parameterObject, RowBounds.DEFAULT);
-                            Number count = (Number) tcm.getObject(cache, cacheKey);
-                            if (count != null) {
-                                page.hitCount(true);
-                                return new PageList((List) result, count.longValue());
-                            } else {
-                                // 某些特殊情况,比如先不查count,缓存了list数据或者count缓存数据被淘汰(这几率比较小),就再查一次算了。
-                                result = delegate.query(ms, parameterObject, rowBounds, resultHandler, key, boundSql);
-                                List<E> records = (List<E>) result;
-                                tcm.putObject(cache, cacheKey, page.getTotal());
-                                return records;
-                            }
-                        }
-                        return new PageList((List) result, 0L);
-                    } else {
-                        return (List<E>) result;
-                    }
-                }
-            }
-        }
-        return delegate.query(ms, parameterObject, rowBounds, resultHandler, key, boundSql);
-    }
-
-    private MappedStatement buildCountMappedStatement(MappedStatement mappedStatement) {
-        // 暂时补充点属性,留着后面分离count查询,这里暂时用到的也就只有id,所以不会影响后面的流程.
-        return new MappedStatement.Builder(mappedStatement.getConfiguration(), mappedStatement.getId() + StringPool.DOT + "count", mappedStatement.getSqlSource(), SqlCommandType.SELECT)
-            .useCache(true)
-            .flushCacheRequired(false)
-            .lang(mappedStatement.getLang())
-            .resource(mappedStatement.getResource())
-            .databaseId(mappedStatement.getDatabaseId())
-            .cache(mappedStatement.getCache())
-            .build();
-    }
-
-    protected CacheKey getCountCacheKey(MappedStatement mappedStatement, BoundSql boundSql, Object parameterObject, RowBounds rowBounds) {
-        Configuration configuration = mappedStatement.getConfiguration();
-//        BoundSql sourceSql = new BoundSql(mappedStatement.getConfiguration(), boundSql.getSql(), boundSql.getParameterMappings(), boundSql.getParameterObject());
-        MappedStatement statement = buildCountMappedStatement(mappedStatement);
-        CacheKey cacheKey = new CacheKey();
-        cacheKey.update(statement.getId());
-        cacheKey.update(rowBounds.getOffset());
-        cacheKey.update(rowBounds.getLimit());
-        cacheKey.update(boundSql.getSql());
-        List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
-        TypeHandlerRegistry typeHandlerRegistry = mappedStatement.getConfiguration().getTypeHandlerRegistry();
-        // mimic DefaultParameterHandler logic
-        for (ParameterMapping parameterMapping : parameterMappings) {
-            if (parameterMapping.getMode() != ParameterMode.OUT) {
-                Object value;
-                String propertyName = parameterMapping.getProperty();
-                if (boundSql.hasAdditionalParameter(propertyName)) {
-                    value = boundSql.getAdditionalParameter(propertyName);
-                } else if (parameterObject == null) {
-                    value = null;
-                } else if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) {
-                    value = parameterObject;
-                } else {
-                    MetaObject metaObject = configuration.newMetaObject(parameterObject);
-                    value = metaObject.getValue(propertyName);
-                }
-                cacheKey.update(value);
-            }
-        }
-        if (configuration.getEnvironment() != null) {
-            // issue #176
-            cacheKey.update(configuration.getEnvironment().getId());
-        }
-        return cacheKey;
-    }
-
-    @Override
-    public List<BatchResult> flushStatements() throws SQLException {
-        return delegate.flushStatements();
-    }
-
-    @Override
-    public void commit(boolean required) throws SQLException {
-        delegate.commit(required);
-        tcm.commit();
-    }
-
-    @Override
-    public void rollback(boolean required) throws SQLException {
-        try {
-            delegate.rollback(required);
-        } finally {
-            if (required) {
-                tcm.rollback();
-            }
-        }
-    }
-
-    private void ensureNoOutParams(MappedStatement ms, BoundSql boundSql) {
-        if (ms.getStatementType() == StatementType.CALLABLE) {
-            for (ParameterMapping parameterMapping : boundSql.getParameterMappings()) {
-                if (parameterMapping.getMode() != ParameterMode.IN) {
-                    throw new ExecutorException("Caching stored procedures with OUT params is not supported.  Please configure useCache=false in " + ms.getId() + " statement.");
-                }
-            }
-        }
-    }
-
-    @Override
-    public CacheKey createCacheKey(MappedStatement ms, Object parameterObject, RowBounds rowBounds, BoundSql boundSql) {
-        return delegate.createCacheKey(ms, parameterObject, rowBounds, boundSql);
-    }
-
-    @Override
-    public boolean isCached(MappedStatement ms, CacheKey key) {
-        return delegate.isCached(ms, key);
-    }
-
-    @Override
-    public void deferLoad(MappedStatement ms, MetaObject resultObject, String property, CacheKey key, Class<?> targetType) {
-        delegate.deferLoad(ms, resultObject, property, key, targetType);
-    }
-
-    @Override
-    public void clearLocalCache() {
-        delegate.clearLocalCache();
-    }
-
-    private void flushCacheIfRequired(MappedStatement ms) {
-        Cache cache = ms.getCache();
-        if (cache != null && ms.isFlushCacheRequired()) {
-            tcm.clear(cache);
-        }
-    }
-
-    @Override
-    public void setExecutorWrapper(Executor executor) {
-        throw new UnsupportedOperationException("This method should not be called");
-    }
-
-}

+ 0 - 120
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisReuseExecutor.java

@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.executor;
-
-import org.apache.ibatis.cursor.Cursor;
-import org.apache.ibatis.executor.BatchResult;
-import org.apache.ibatis.executor.statement.StatementHandler;
-import org.apache.ibatis.logging.Log;
-import org.apache.ibatis.mapping.BoundSql;
-import org.apache.ibatis.mapping.MappedStatement;
-import org.apache.ibatis.session.Configuration;
-import org.apache.ibatis.session.ResultHandler;
-import org.apache.ibatis.session.RowBounds;
-import org.apache.ibatis.transaction.Transaction;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 重写执行器 {@link org.apache.ibatis.executor.ReuseExecutor}
- *
- * @author nieqiurong 2019/4/14.
- * @deprecated 3.4.0
- */
-@Deprecated
-public class MybatisReuseExecutor extends AbstractBaseExecutor {
-
-    private final Map<String, Statement> statementMap = new HashMap<>();
-
-    public MybatisReuseExecutor(Configuration configuration, Transaction transaction) {
-        super(configuration, transaction);
-    }
-
-    @Override
-    public int doUpdate(MappedStatement ms, Object parameter) throws SQLException {
-        Configuration configuration = ms.getConfiguration();
-        StatementHandler handler = configuration.newStatementHandler(this, ms, parameter, RowBounds.DEFAULT, null, null);
-        Statement stmt = prepareStatement(handler, ms.getStatementLog(), false);
-        return stmt == null ? 0 : handler.update(stmt);
-    }
-
-    @Override
-    public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
-        Configuration configuration = ms.getConfiguration();
-        StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
-        Statement stmt = prepareStatement(handler, ms.getStatementLog(), false);
-        return stmt == null ? Collections.emptyList() : handler.query(stmt, resultHandler);
-    }
-
-    @Override
-    protected <E> Cursor<E> doQueryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds, BoundSql boundSql) throws SQLException {
-        Configuration configuration = ms.getConfiguration();
-        StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, null, boundSql);
-        Statement stmt = prepareStatement(handler, ms.getStatementLog(), true);
-        return handler.queryCursor(stmt);
-    }
-
-    @Override
-    public List<BatchResult> doFlushStatements(boolean isRollback) {
-        for (Statement stmt : statementMap.values()) {
-            closeStatement(stmt);
-        }
-        statementMap.clear();
-        return Collections.emptyList();
-    }
-
-    private Statement prepareStatement(StatementHandler handler, Log statementLog, boolean isCursor) throws SQLException {
-        Statement stmt;
-        BoundSql boundSql = handler.getBoundSql();
-        String sql = boundSql.getSql();
-        if (hasStatementFor(sql)) {
-            stmt = getStatement(sql);
-            applyTransactionTimeout(stmt);
-        } else {
-            Connection connection = getConnection(statementLog);
-            stmt = handler.prepare(connection, transaction.getTimeout());
-            //游标不支持返回null.
-            if (stmt == null && !isCursor) {
-                return null;
-            }
-            putStatement(sql, stmt);
-        }
-        handler.parameterize(stmt);
-        return stmt;
-    }
-
-    private boolean hasStatementFor(String sql) {
-        try {
-            return statementMap.containsKey(sql) && !statementMap.get(sql).getConnection().isClosed();
-        } catch (SQLException e) {
-            return false;
-        }
-    }
-
-    private Statement getStatement(String s) {
-        return statementMap.get(s);
-    }
-
-    private void putStatement(String sql, Statement stmt) {
-        statementMap.put(sql, stmt);
-    }
-}

+ 0 - 103
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisSimpleExecutor.java

@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.executor;
-
-import org.apache.ibatis.cursor.Cursor;
-import org.apache.ibatis.executor.BatchResult;
-import org.apache.ibatis.executor.statement.StatementHandler;
-import org.apache.ibatis.logging.Log;
-import org.apache.ibatis.mapping.BoundSql;
-import org.apache.ibatis.mapping.MappedStatement;
-import org.apache.ibatis.session.Configuration;
-import org.apache.ibatis.session.ResultHandler;
-import org.apache.ibatis.session.RowBounds;
-import org.apache.ibatis.transaction.Transaction;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * 重写执行器 {@link org.apache.ibatis.executor.SimpleExecutor}
- *
- * @author nieqiurong 2019/4/14.
- * @deprecated 3.4.0
- */
-@Deprecated
-public class MybatisSimpleExecutor extends AbstractBaseExecutor {
-
-    public MybatisSimpleExecutor(Configuration configuration, Transaction transaction) {
-        super(configuration, transaction);
-    }
-
-
-    @Override
-    public int doUpdate(MappedStatement ms, Object parameter) throws SQLException {
-        Statement stmt = null;
-        try {
-            Configuration configuration = ms.getConfiguration();
-            StatementHandler handler = configuration.newStatementHandler(this, ms, parameter, RowBounds.DEFAULT, null, null);
-            stmt = prepareStatement(handler, ms.getStatementLog(), false);
-            return stmt == null ? 0 : handler.update(stmt);
-        } finally {
-            closeStatement(stmt);
-        }
-    }
-
-    @Override
-    public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
-        Statement stmt = null;
-        try {
-            Configuration configuration = ms.getConfiguration();
-            StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql);
-            stmt = prepareStatement(handler, ms.getStatementLog(), false);
-            return stmt == null ? Collections.emptyList() : handler.query(stmt, resultHandler);
-        } finally {
-            closeStatement(stmt);
-        }
-    }
-
-    @Override
-    protected <E> Cursor<E> doQueryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds, BoundSql boundSql) throws SQLException {
-        Configuration configuration = ms.getConfiguration();
-        StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, null, boundSql);
-        Statement stmt = prepareStatement(handler, ms.getStatementLog(), true);
-        assert stmt != null;
-        Cursor<E> cursor = handler.queryCursor(stmt);
-        stmt.closeOnCompletion();
-        return cursor;
-    }
-
-    @Override
-    public List<BatchResult> doFlushStatements(boolean isRollback) {
-        return Collections.emptyList();
-    }
-
-    private Statement prepareStatement(StatementHandler handler, Log statementLog, boolean isCursor) throws SQLException {
-        Statement stmt;
-        Connection connection = getConnection(statementLog);
-        stmt = handler.prepare(connection, transaction.getTimeout());
-        //游标不支持返回null.
-        if (stmt == null && !isCursor) {
-            return null;
-        } else {
-            handler.parameterize(stmt);
-            return stmt;
-        }
-    }
-}

+ 12 - 24
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/handlers/MybatisEnumTypeHandler.java

@@ -47,13 +47,13 @@ import java.util.concurrent.ConcurrentHashMap;
  * @since 2017-10-11
  * @since 2017-10-11
  */
  */
 public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E> {
 public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E> {
-    
+
     private static final Map<String, String> TABLE_METHOD_OF_ENUM_TYPES = new ConcurrentHashMap<>();
     private static final Map<String, String> TABLE_METHOD_OF_ENUM_TYPES = new ConcurrentHashMap<>();
     private static final ReflectorFactory REFLECTOR_FACTORY = new DefaultReflectorFactory();
     private static final ReflectorFactory REFLECTOR_FACTORY = new DefaultReflectorFactory();
     private final Class<E> enumClassType;
     private final Class<E> enumClassType;
     private final Class<?> propertyType;
     private final Class<?> propertyType;
     private final Invoker getInvoker;
     private final Invoker getInvoker;
-    
+
     public MybatisEnumTypeHandler(Class<E> enumClassType) {
     public MybatisEnumTypeHandler(Class<E> enumClassType) {
         if (enumClassType == null) {
         if (enumClassType == null) {
             throw new IllegalArgumentException("Type argument cannot be null");
             throw new IllegalArgumentException("Type argument cannot be null");
@@ -67,19 +67,7 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
         this.propertyType = ReflectionKit.resolvePrimitiveIfNecessary(metaClass.getGetterType(name));
         this.propertyType = ReflectionKit.resolvePrimitiveIfNecessary(metaClass.getGetterType(name));
         this.getInvoker = metaClass.getGetInvoker(name);
         this.getInvoker = metaClass.getGetInvoker(name);
     }
     }
-    
-    /**
-     * 查找标记EnumValue字段
-     *
-     * @param clazz class
-     * @return EnumValue字段
-     * @deprecated 3.3.1 {@link #findEnumValueFieldName(Class)}
-     */
-    @Deprecated
-    public static Optional<Field> dealEnumType(Class<?> clazz) {
-        return clazz.isEnum() ? Arrays.stream(clazz.getDeclaredFields()).filter(field -> field.isAnnotationPresent(EnumValue.class)).findFirst() : Optional.empty();
-    }
-    
+
     /**
     /**
      * 查找标记标记EnumValue字段
      * 查找标记标记EnumValue字段
      *
      *
@@ -97,11 +85,11 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
         }
         }
         return Optional.empty();
         return Optional.empty();
     }
     }
-    
+
     private static Optional<Field> findEnumValueAnnotationField(Class<?> clazz) {
     private static Optional<Field> findEnumValueAnnotationField(Class<?> clazz) {
         return Arrays.stream(clazz.getDeclaredFields()).filter(field -> field.isAnnotationPresent(EnumValue.class)).findFirst();
         return Arrays.stream(clazz.getDeclaredFields()).filter(field -> field.isAnnotationPresent(EnumValue.class)).findFirst();
     }
     }
-    
+
     /**
     /**
      * 判断是否为MP枚举处理
      * 判断是否为MP枚举处理
      *
      *
@@ -112,7 +100,7 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
     public static boolean isMpEnums(Class<?> clazz) {
     public static boolean isMpEnums(Class<?> clazz) {
         return clazz != null && clazz.isEnum() && (IEnum.class.isAssignableFrom(clazz) || findEnumValueFieldName(clazz).isPresent());
         return clazz != null && clazz.isEnum() && (IEnum.class.isAssignableFrom(clazz) || findEnumValueFieldName(clazz).isPresent());
     }
     }
-    
+
     @SuppressWarnings("Duplicates")
     @SuppressWarnings("Duplicates")
     @Override
     @Override
     public void setNonNullParameter(PreparedStatement ps, int i, E parameter, JdbcType jdbcType)
     public void setNonNullParameter(PreparedStatement ps, int i, E parameter, JdbcType jdbcType)
@@ -124,7 +112,7 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
             ps.setObject(i, this.getValue(parameter), jdbcType.TYPE_CODE);
             ps.setObject(i, this.getValue(parameter), jdbcType.TYPE_CODE);
         }
         }
     }
     }
-    
+
     @Override
     @Override
     public E getNullableResult(ResultSet rs, String columnName) throws SQLException {
     public E getNullableResult(ResultSet rs, String columnName) throws SQLException {
         Object value = rs.getObject(columnName, this.propertyType);
         Object value = rs.getObject(columnName, this.propertyType);
@@ -133,7 +121,7 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
         }
         }
         return this.valueOf(value);
         return this.valueOf(value);
     }
     }
-    
+
     @Override
     @Override
     public E getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
     public E getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
         Object value = rs.getObject(columnIndex, this.propertyType);
         Object value = rs.getObject(columnIndex, this.propertyType);
@@ -142,7 +130,7 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
         }
         }
         return this.valueOf(value);
         return this.valueOf(value);
     }
     }
-    
+
     @Override
     @Override
     public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
     public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
         Object value = cs.getObject(columnIndex, this.propertyType);
         Object value = cs.getObject(columnIndex, this.propertyType);
@@ -151,12 +139,12 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
         }
         }
         return this.valueOf(value);
         return this.valueOf(value);
     }
     }
-    
+
     private E valueOf(Object value) {
     private E valueOf(Object value) {
         E[] es = this.enumClassType.getEnumConstants();
         E[] es = this.enumClassType.getEnumConstants();
         return Arrays.stream(es).filter((e) -> equalsValue(value, getValue(e))).findAny().orElse(null);
         return Arrays.stream(es).filter((e) -> equalsValue(value, getValue(e))).findAny().orElse(null);
     }
     }
-    
+
     /**
     /**
      * 值比较
      * 值比较
      *
      *
@@ -174,7 +162,7 @@ public class MybatisEnumTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E
         }
         }
         return Objects.equals(sValue, tValue);
         return Objects.equals(sValue, tValue);
     }
     }
-    
+
     private Object getValue(Object object) {
     private Object getValue(Object object) {
         try {
         try {
             return this.getInvoker.invoke(object, new Object[0]);
             return this.getInvoker.invoke(object, new Object[0]);

+ 0 - 60
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/metadata/IPage.java

@@ -15,12 +15,8 @@
  */
  */
 package com.baomidou.mybatisplus.core.metadata;
 package com.baomidou.mybatisplus.core.metadata;
 
 
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 import java.util.function.Function;
 import java.util.function.Function;
 
 
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toList;
@@ -40,17 +36,6 @@ public interface IPage<T> extends Serializable {
      */
      */
     List<OrderItem> orders();
     List<OrderItem> orders();
 
 
-    /**
-     * KEY/VALUE 条件
-     *
-     * @return ignore
-     * @deprecated 3.4.0 @2020-06-30
-     */
-    @Deprecated
-    default Map<Object, Object> condition() {
-        return null;
-    }
-
     /**
     /**
      * 自动优化 COUNT SQL【 默认:true 】
      * 自动优化 COUNT SQL【 默认:true 】
      *
      *
@@ -112,30 +97,6 @@ public interface IPage<T> extends Serializable {
         return this;
         return this;
     }
     }
 
 
-    /**
-     * 设置是否命中count缓存
-     *
-     * @param hit 是否命中
-     * @since 3.3.1
-     * @deprecated 3.4.0 @2020-06-30 缓存遵循mybatis的一或二缓
-     */
-    @Deprecated
-    default void hitCount(boolean hit) {
-
-    }
-
-    /**
-     * 是否命中count缓存
-     *
-     * @return 是否命中count缓存
-     * @since 3.3.1
-     * @deprecated 3.4.0 @2020-06-30 缓存遵循mybatis的一或二缓
-     */
-    @Deprecated
-    default boolean isHitCount() {
-        return false;
-    }
-
     /**
     /**
      * 分页记录列表
      * 分页记录列表
      *
      *
@@ -208,25 +169,4 @@ public interface IPage<T> extends Serializable {
     default String countId() {
     default String countId() {
         return null;
         return null;
     }
     }
-
-    /**
-     * 生成缓存key值
-     *
-     * @return 缓存key值
-     * @since 3.3.2
-     * @deprecated 3.4.0 @2020-06-30
-     */
-    @Deprecated
-    default String cacheKey() {
-        StringBuilder key = new StringBuilder();
-        key.append(offset()).append(StringPool.COLON).append(getSize());
-        List<OrderItem> orders = orders();
-        if (CollectionUtils.isNotEmpty(orders)) {
-            for (OrderItem item : orders) {
-                key.append(StringPool.COLON).append(item.getColumn()).append(StringPool.COLON).append(item.isAsc());
-            }
-        }
-        return key.toString();
-    }
-
 }
 }

+ 0 - 48
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/metadata/PageList.java

@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.metadata;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 受限于SqlSession#selectList(java.lang.String, java.lang.Object)
- *
- * @author nieqiuqiu
- * @since 3.3.0
- * @deprecated 3.4.3
- */
-@Data
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@Deprecated
-public final class PageList<T> extends ArrayList<T> {
-
-    /**
-     * 记录数
-     */
-    private List<T> records;
-
-    /**
-     * 总数
-     */
-    private long total;
-
-}

+ 1 - 9
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/override/MybatisMapperMethod.java

@@ -16,7 +16,6 @@
 package com.baomidou.mybatisplus.core.override;
 package com.baomidou.mybatisplus.core.override;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.metadata.PageList;
 import com.baomidou.mybatisplus.core.toolkit.Assert;
 import com.baomidou.mybatisplus.core.toolkit.Assert;
 import org.apache.ibatis.binding.BindingException;
 import org.apache.ibatis.binding.BindingException;
 import org.apache.ibatis.binding.MapperMethod;
 import org.apache.ibatis.binding.MapperMethod;
@@ -120,14 +119,7 @@ public class MybatisMapperMethod {
         Assert.notNull(result, "can't found IPage for args!");
         Assert.notNull(result, "can't found IPage for args!");
         Object param = method.convertArgsToSqlCommandParam(args);
         Object param = method.convertArgsToSqlCommandParam(args);
         List<E> list = sqlSession.selectList(command.getName(), param);
         List<E> list = sqlSession.selectList(command.getName(), param);
-        //TODO 与com.baomidou.mybatisplus.core.executor一起移除.
-        if (list instanceof PageList) {
-            PageList<E> pageList = (PageList<E>) list;
-            result.setRecords(pageList.getRecords());
-            result.setTotal(pageList.getTotal());
-        } else {
-            result.setRecords(list);
-        }
+        result.setRecords(list);
         return result;
         return result;
     }
     }
 
 

+ 0 - 116
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/parser/SqlParserHelper.java

@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.parser;
-
-import com.baomidou.mybatisplus.annotation.SqlParser;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import org.apache.ibatis.mapping.MappedStatement;
-import org.apache.ibatis.reflection.MetaObject;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * SQL 解析辅助类
- *
- * @author hubin
- * @since 2018-07-22
- * @deprecated 3.4.0
- */
-@Deprecated
-public class SqlParserHelper {
-
-    public static final String DELEGATE_MAPPED_STATEMENT = "delegate.mappedStatement";
-    /**
-     * SQL 解析缓存
-     * key 可能是 mappedStatement 的 ID,也可能是 class 的 name
-     */
-    private static final Map<String, Boolean> SQL_PARSER_INFO_CACHE = new ConcurrentHashMap<>();
-
-    /**
-     * 初始化缓存 接口上 SqlParser 注解信息
-     *
-     * @param mapperClass Mapper Class
-     */
-    public synchronized static void initSqlParserInfoCache(Class<?> mapperClass) {
-        SqlParser sqlParser = mapperClass.getAnnotation(SqlParser.class);
-        if (sqlParser != null) {
-            SQL_PARSER_INFO_CACHE.put(mapperClass.getName(), sqlParser.filter());
-        }
-    }
-
-    /**
-     * 初始化缓存 方法上 SqlParser 注解信息
-     *
-     * @param mapperClassName Mapper Class Name
-     * @param method          Method
-     */
-    public static void initSqlParserInfoCache(String mapperClassName, Method method) {
-        SqlParser sqlParser = method.getAnnotation(SqlParser.class);
-        if (sqlParser != null) {
-            if (SQL_PARSER_INFO_CACHE.containsKey(mapperClassName)) {
-                // mapper 接口上有注解
-                Boolean value = SQL_PARSER_INFO_CACHE.get(mapperClassName);
-                if (!value.equals(sqlParser.filter())) {
-                    // 取反,不属于重复注解,放入缓存
-                    String sid = mapperClassName + StringPool.DOT + method.getName();
-                    SQL_PARSER_INFO_CACHE.putIfAbsent(sid, sqlParser.filter());
-                }
-            } else {
-                String sid = mapperClassName + StringPool.DOT + method.getName();
-                SQL_PARSER_INFO_CACHE.putIfAbsent(sid, sqlParser.filter());
-            }
-        }
-    }
-
-    /**
-     * 获取 SqlParser 注解信息
-     */
-    public static boolean getSqlParserInfo(MappedStatement ms) {
-        String id = ms.getId();
-        Boolean value = SQL_PARSER_INFO_CACHE.get(id);
-        if (value != null) {
-            return value;
-        }
-        String mapperName = id.substring(0, id.lastIndexOf(StringPool.DOT));
-        return SQL_PARSER_INFO_CACHE.getOrDefault(mapperName, false);
-    }
-
-    /**
-     * 获取 SqlParser 注解信息
-     *
-     * @param metaObject 元数据对象
-     */
-    public static boolean getSqlParserInfo(MetaObject metaObject) {
-        String id = getMappedStatement(metaObject).getId();
-        Boolean value = SQL_PARSER_INFO_CACHE.get(id);
-        if (value != null) {
-            return value;
-        }
-        String mapperName = id.substring(0, id.lastIndexOf(StringPool.DOT));
-        return SQL_PARSER_INFO_CACHE.getOrDefault(mapperName, false);
-    }
-
-    /**
-     * 获取当前执行 MappedStatement
-     *
-     * @param metaObject 元对象
-     */
-    public static MappedStatement getMappedStatement(MetaObject metaObject) {
-        return (MappedStatement) metaObject.getValue(DELEGATE_MAPPED_STATEMENT);
-    }
-}

+ 0 - 67
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/EnumUtils.java

@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.core.toolkit;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.math.BigDecimal;
-import java.util.Objects;
-
-
-/**
- * 枚举处理工具类
- *
- * @author hubin
- * @since 2017-10-11
- * @deprecated 3.3.0
- */
-@Deprecated
-public class EnumUtils {
-    
-    /**
-     * 值映射为枚举
-     *
-     * @param enumClass 枚举类
-     * @param value     枚举值
-     * @param method    取值方法
-     * @param <E>       对应枚举
-     * @return 枚举
-     * @deprecated 3.2.1
-     */
-    @Deprecated
-    public static <E extends Enum<?>> E valueOf(Class<E> enumClass, Object value, Method method) {
-        E[] es = enumClass.getEnumConstants();
-        for (E e : es) {
-            Object evalue;
-            try {
-                method.setAccessible(true);
-                evalue = method.invoke(e);
-            } catch (IllegalAccessException | InvocationTargetException e1) {
-                throw ExceptionUtils.mpe("Error: NoSuchMethod in %s.  Cause:", e, enumClass.getName());
-            }
-            if (value instanceof Number && evalue instanceof Number
-                && new BigDecimal(String.valueOf(value)).compareTo(new BigDecimal(String.valueOf(evalue))) == 0) {
-                return e;
-            }
-            if (Objects.equals(evalue, value)) {
-                return e;
-            }
-        }
-        return null;
-    }
-
-}

+ 14 - 60
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/ReflectionKit.java

@@ -45,7 +45,7 @@ public final class ReflectionKit {
     private static final Map<Class<?>, List<Field>> CLASS_FIELD_CACHE = new ConcurrentHashMap<>();
     private static final Map<Class<?>, List<Field>> CLASS_FIELD_CACHE = new ConcurrentHashMap<>();
 
 
     private static final Map<Class<?>, Class<?>> PRIMITIVE_WRAPPER_TYPE_MAP = new IdentityHashMap<>(8);
     private static final Map<Class<?>, Class<?>> PRIMITIVE_WRAPPER_TYPE_MAP = new IdentityHashMap<>(8);
-    
+
     private static final Map<Class<?>, Class<?>> PRIMITIVE_TYPE_TO_WRAPPER_MAP = new IdentityHashMap<>(8);
     private static final Map<Class<?>, Class<?>> PRIMITIVE_TYPE_TO_WRAPPER_MAP = new IdentityHashMap<>(8);
 
 
     static {
     static {
@@ -62,21 +62,6 @@ public final class ReflectionKit {
         }
         }
     }
     }
 
 
-    /**
-     * <p>
-     * 反射 method 方法名,例如 setVersion
-     * </p>
-     *
-     * @param field Field
-     * @param str   String JavaBean类的version属性名
-     * @return version属性的setter方法名称,e.g. setVersion
-     * @deprecated 3.0.8
-     */
-    @Deprecated
-    public static String setMethodCapitalize(Field field, final String str) {
-        return StringUtils.concatCapitalize("set", str);
-    }
-
     /**
     /**
      * 获取字段值
      * 获取字段值
      *
      *
@@ -115,12 +100,12 @@ public final class ReflectionKit {
         Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
         Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
         if (index >= params.length || index < 0) {
         if (index >= params.length || index < 0) {
             logger.warn(String.format("Warn: Index: %s, Size of %s's Parameterized Type: %s .", index,
             logger.warn(String.format("Warn: Index: %s, Size of %s's Parameterized Type: %s .", index,
-                    clazz.getSimpleName(), params.length));
+                clazz.getSimpleName(), params.length));
             return Object.class;
             return Object.class;
         }
         }
         if (!(params[index] instanceof Class)) {
         if (!(params[index] instanceof Class)) {
             logger.warn(String.format("Warn: %s not set the actual class on superclass generic parameter",
             logger.warn(String.format("Warn: %s not set the actual class on superclass generic parameter",
-                    clazz.getSimpleName()));
+                clazz.getSimpleName()));
             return Object.class;
             return Object.class;
         }
         }
         return (Class<?>) params[index];
         return (Class<?>) params[index];
@@ -166,45 +151,14 @@ public final class ReflectionKit {
              * 中间表实体重写父类属性 ` private transient Date createTime; `
              * 中间表实体重写父类属性 ` private transient Date createTime; `
              */
              */
             return fieldMap.values().stream()
             return fieldMap.values().stream()
-                    /* 过滤静态属性 */
-                    .filter(f -> !Modifier.isStatic(f.getModifiers()))
-                    /* 过滤 transient关键字修饰的属性 */
-                    .filter(f -> !Modifier.isTransient(f.getModifiers()))
-                    .collect(Collectors.toList());
+                /* 过滤静态属性 */
+                .filter(f -> !Modifier.isStatic(f.getModifiers()))
+                /* 过滤 transient关键字修饰的属性 */
+                .filter(f -> !Modifier.isTransient(f.getModifiers()))
+                .collect(Collectors.toList());
         });
         });
     }
     }
 
 
-    /**
-     * <p>
-     * 获取该类的所有属性列表
-     * </p>
-     *
-     * @param clazz 反射类
-     * @deprecated 3.4.0
-     */
-    @Deprecated
-    public static List<Field> doGetFieldList(Class<?> clazz) {
-        if (clazz.getSuperclass() != null) {
-            /* 排除重载属性 */
-            Map<String, Field> fieldMap = excludeOverrideSuperField(clazz.getDeclaredFields(),
-                    /* 处理父类字段 */
-                    getFieldList(clazz.getSuperclass()));
-            /*
-             * 重写父类属性过滤后处理忽略部分,支持过滤父类属性功能
-             * 场景:中间表不需要记录创建时间,忽略父类 createTime 公共属性
-             * 中间表实体重写父类属性 ` private transient Date createTime; `
-             */
-            return fieldMap.values().stream()
-                    /* 过滤静态属性 */
-                    .filter(f -> !Modifier.isStatic(f.getModifiers()))
-                    /* 过滤 transient关键字修饰的属性 */
-                    .filter(f -> !Modifier.isTransient(f.getModifiers()))
-                    .collect(Collectors.toList());
-        } else {
-            return Collections.emptyList();
-        }
-    }
-
     /**
     /**
      * <p>
      * <p>
      * 排序重置父类属性
      * 排序重置父类属性
@@ -216,12 +170,12 @@ public final class ReflectionKit {
     public static Map<String, Field> excludeOverrideSuperField(Field[] fields, List<Field> superFieldList) {
     public static Map<String, Field> excludeOverrideSuperField(Field[] fields, List<Field> superFieldList) {
         // 子类属性
         // 子类属性
         Map<String, Field> fieldMap = Stream.of(fields).collect(toMap(Field::getName, identity(),
         Map<String, Field> fieldMap = Stream.of(fields).collect(toMap(Field::getName, identity(),
-                (u, v) -> {
-                    throw new IllegalStateException(String.format("Duplicate key %s", u));
-                },
-                LinkedHashMap::new));
+            (u, v) -> {
+                throw new IllegalStateException(String.format("Duplicate key %s", u));
+            },
+            LinkedHashMap::new));
         superFieldList.stream().filter(field -> !fieldMap.containsKey(field.getName()))
         superFieldList.stream().filter(field -> !fieldMap.containsKey(field.getName()))
-                .forEach(f -> fieldMap.put(f.getName(), f));
+            .forEach(f -> fieldMap.put(f.getName(), f));
         return fieldMap;
         return fieldMap;
     }
     }
 
 
@@ -235,7 +189,7 @@ public final class ReflectionKit {
         Assert.notNull(clazz, "Class must not be null");
         Assert.notNull(clazz, "Class must not be null");
         return (clazz.isPrimitive() || PRIMITIVE_WRAPPER_TYPE_MAP.containsKey(clazz));
         return (clazz.isPrimitive() || PRIMITIVE_WRAPPER_TYPE_MAP.containsKey(clazz));
     }
     }
-    
+
     public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) {
     public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) {
         return (clazz.isPrimitive() && clazz != void.class ? PRIMITIVE_TYPE_TO_WRAPPER_MAP.get(clazz) : clazz);
         return (clazz.isPrimitive() && clazz != void.class ? PRIMITIVE_TYPE_TO_WRAPPER_MAP.get(clazz) : clazz);
     }
     }

+ 3 - 9
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/support/SerializedLambda.java

@@ -50,13 +50,7 @@ public class SerializedLambda implements Serializable {
      *
      *
      * @param lambda lambda对象
      * @param lambda lambda对象
      * @return 返回解析后的 SerializedLambda
      * @return 返回解析后的 SerializedLambda
-     * @deprecated 3.4.2 {@link #resolve(SFunction, ClassLoader)}
      */
      */
-    @Deprecated
-    public static SerializedLambda resolve(SFunction<?, ?> lambda) {
-        return resolve(lambda, null);
-    }
-
     public static SerializedLambda resolve(SFunction<?, ?> lambda, ClassLoader classLoader) {
     public static SerializedLambda resolve(SFunction<?, ?> lambda, ClassLoader classLoader) {
         if (!lambda.getClass().isSynthetic()) {
         if (!lambda.getClass().isSynthetic()) {
             throw ExceptionUtils.mpe("该方法仅能传入 lambda 表达式产生的合成类");
             throw ExceptionUtils.mpe("该方法仅能传入 lambda 表达式产生的合成类");
@@ -141,9 +135,9 @@ public class SerializedLambda implements Serializable {
         String interfaceName = getFunctionalInterfaceClassName();
         String interfaceName = getFunctionalInterfaceClassName();
         String implName = getImplClassName();
         String implName = getImplClassName();
         return String.format("%s -> %s::%s",
         return String.format("%s -> %s::%s",
-                interfaceName.substring(interfaceName.lastIndexOf('.') + 1),
-                implName.substring(implName.lastIndexOf('.') + 1),
-                implMethodName);
+            interfaceName.substring(interfaceName.lastIndexOf('.') + 1),
+            implName.substring(implName.lastIndexOf('.') + 1),
+            implMethodName);
     }
     }
 
 
 }
 }

+ 3 - 5
mybatis-plus-core/src/test/java/com/baomidou/mybatisplus/core/conditions/UpdateWrapperTest.java

@@ -2,8 +2,6 @@ package com.baomidou.mybatisplus.core.conditions;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.test.User;
 import com.baomidou.mybatisplus.test.User;
-import org.apache.ibatis.type.JdbcType;
-import org.apache.ibatis.type.StringTypeHandler;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 
 
 /**
 /**
@@ -15,9 +13,9 @@ class UpdateWrapperTest extends BaseWrapperTest {
     @Test
     @Test
     void test1() {
     void test1() {
         UpdateWrapper<User> wrapper = new UpdateWrapper<User>()
         UpdateWrapper<User> wrapper = new UpdateWrapper<User>()
-            .set("name", "a", StringTypeHandler.class)
-            .set("name", "a", StringTypeHandler.class, JdbcType.VARCHAR)
-            .set("name", "a", StringTypeHandler.class, JdbcType.VARCHAR, 2);
+            .set("name", "a", "typeHandler=org.apache.ibatis.type.StringTypeHandler")
+            .set("name", "a", "typeHandler=org.apache.ibatis.type.StringTypeHandler,jdbcType=VARCHAR")
+            .set("name", "a", "typeHandler=org.apache.ibatis.type.StringTypeHandler,jdbcType=VARCHAR,numericScale=2");
         logSqlSet("ss", wrapper,
         logSqlSet("ss", wrapper,
             "name=#{ew.paramNameValuePairs.MPGENVAL1,typeHandler=org.apache.ibatis.type.StringTypeHandler}," +
             "name=#{ew.paramNameValuePairs.MPGENVAL1,typeHandler=org.apache.ibatis.type.StringTypeHandler}," +
                 "name=#{ew.paramNameValuePairs.MPGENVAL2,typeHandler=org.apache.ibatis.type.StringTypeHandler,jdbcType=VARCHAR}," +
                 "name=#{ew.paramNameValuePairs.MPGENVAL2,typeHandler=org.apache.ibatis.type.StringTypeHandler,jdbcType=VARCHAR}," +

+ 0 - 88
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/handlers/AbstractSqlParserHandler.java

@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.extension.handlers;
-
-import com.baomidou.mybatisplus.core.parser.ISqlParser;
-import com.baomidou.mybatisplus.core.parser.ISqlParserFilter;
-import com.baomidou.mybatisplus.core.parser.SqlInfo;
-import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
-import lombok.Data;
-import lombok.experimental.Accessors;
-import org.apache.ibatis.executor.statement.CallableStatementHandler;
-import org.apache.ibatis.executor.statement.StatementHandler;
-import org.apache.ibatis.reflection.MetaObject;
-import org.apache.ibatis.reflection.SystemMetaObject;
-
-import java.util.List;
-
-/**
- * SQL 解析处理器
- *
- * @author hubin
- * @since 2016-08-31
- */
-@Data
-@Accessors(chain = true)
-public abstract class AbstractSqlParserHandler {
-
-    private List<ISqlParser> sqlParserList;
-    private ISqlParserFilter sqlParserFilter;
-
-    /**
-     * 拦截 SQL 解析执行
-     */
-    protected void sqlParser(MetaObject metaObject) {
-        if (null != metaObject) {
-            Object originalObject = metaObject.getOriginalObject();
-            StatementHandler statementHandler = PluginUtils.realTarget(originalObject);
-            metaObject = SystemMetaObject.forObject(statementHandler);
-
-            if (null != this.sqlParserFilter && this.sqlParserFilter.doFilter(metaObject)) {
-                return;
-            }
-
-            // @SqlParser(filter = true) 跳过该方法解析
-            if (SqlParserHelper.getSqlParserInfo(metaObject)) {
-                return;
-            }
-
-            // SQL 解析
-            if (CollectionUtils.isNotEmpty(this.sqlParserList)) {
-                // 好像不用判断也行,为了保险起见,还是加上吧.
-                statementHandler = metaObject.hasGetter("delegate") ? (StatementHandler) metaObject.getValue("delegate") : statementHandler;
-                if (!(statementHandler instanceof CallableStatementHandler)) {
-                    // 标记是否修改过 SQL
-                    boolean sqlChangedFlag = false;
-                    String originalSql = (String) metaObject.getValue(PluginUtils.DELEGATE_BOUNDSQL_SQL);
-                    for (ISqlParser sqlParser : this.sqlParserList) {
-                        if (sqlParser.doFilter(metaObject, originalSql)) {
-                            SqlInfo sqlInfo = sqlParser.parser(metaObject, originalSql);
-                            if (null != sqlInfo) {
-                                originalSql = sqlInfo.getSql();
-                                sqlChangedFlag = true;
-                            }
-                        }
-                    }
-                    if (sqlChangedFlag) {
-                        metaObject.setValue(PluginUtils.DELEGATE_BOUNDSQL_SQL, originalSql);
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 69
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/handlers/MybatisEnumTypeHandler.java

@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.extension.handlers;
-
-import java.lang.reflect.Field;
-import java.util.Optional;
-
-/**
- * 自定义枚举属性转换器
- *
- * @author hubin
- * @since 2017-10-11
- * @deprecated 3.4.0 @2020-06-23 use {@link com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler}
- */
-@Deprecated
-public class MybatisEnumTypeHandler<E extends Enum<E>> extends com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler<E> {
-
-    public MybatisEnumTypeHandler(Class<E> type) {
-        super(type);
-    }
-
-    /**
-     * 查找标记EnumValue字段
-     *
-     * @param clazz class
-     * @return EnumValue字段
-     * @deprecated 3.3.1 {@link #findEnumValueFieldName(Class)}
-     */
-    @Deprecated
-    public static Optional<Field> dealEnumType(Class<?> clazz) {
-        return com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler.dealEnumType(clazz);
-    }
-
-    /**
-     * 查找标记标记EnumValue字段
-     *
-     * @param clazz class
-     * @return EnumValue字段
-     * @since 3.3.1
-     */
-    public static Optional<String> findEnumValueFieldName(Class<?> clazz) {
-        return com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler.findEnumValueFieldName(clazz);
-    }
-
-    /**
-     * 判断是否为MP枚举处理
-     *
-     * @param clazz class
-     * @return 是否为MP枚举处理
-     * @since 3.3.1
-     */
-    public static boolean isMpEnums(Class<?> clazz) {
-        return com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler.isMpEnums(clazz);
-    }
-    
-}

+ 1 - 3
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/IllegalSQLInnerInterceptor.java

@@ -16,7 +16,6 @@
 package com.baomidou.mybatisplus.extension.plugins.inner;
 package com.baomidou.mybatisplus.extension.plugins.inner;
 
 
 import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
 import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
-import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
 import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
 import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
 import com.baomidou.mybatisplus.core.toolkit.Assert;
 import com.baomidou.mybatisplus.core.toolkit.Assert;
 import com.baomidou.mybatisplus.core.toolkit.EncryptUtils;
 import com.baomidou.mybatisplus.core.toolkit.EncryptUtils;
@@ -93,8 +92,7 @@ public class IllegalSQLInnerInterceptor extends JsqlParserSupport implements Inn
         PluginUtils.MPStatementHandler mpStatementHandler = PluginUtils.mpStatementHandler(sh);
         PluginUtils.MPStatementHandler mpStatementHandler = PluginUtils.mpStatementHandler(sh);
         MappedStatement ms = mpStatementHandler.mappedStatement();
         MappedStatement ms = mpStatementHandler.mappedStatement();
         SqlCommandType sct = ms.getSqlCommandType();
         SqlCommandType sct = ms.getSqlCommandType();
-        if (sct == SqlCommandType.INSERT || InterceptorIgnoreHelper.willIgnoreIllegalSql(ms.getId())
-            || SqlParserHelper.getSqlParserInfo(ms)) return;
+        if (sct == SqlCommandType.INSERT || InterceptorIgnoreHelper.willIgnoreIllegalSql(ms.getId())) return;
         BoundSql boundSql = mpStatementHandler.boundSql();
         BoundSql boundSql = mpStatementHandler.boundSql();
         String originalSql = boundSql.getSql();
         String originalSql = boundSql.getSql();
         logger.debug("检查SQL是否合规,SQL:" + originalSql);
         logger.debug("检查SQL是否合规,SQL:" + originalSql);

+ 0 - 3
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/TenantLineInnerInterceptor.java

@@ -15,7 +15,6 @@
  */
  */
 package com.baomidou.mybatisplus.extension.plugins.inner;
 package com.baomidou.mybatisplus.extension.plugins.inner;
 
 
-import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
 import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
 import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
 import com.baomidou.mybatisplus.core.toolkit.*;
 import com.baomidou.mybatisplus.core.toolkit.*;
 import com.baomidou.mybatisplus.extension.parser.JsqlParserSupport;
 import com.baomidou.mybatisplus.extension.parser.JsqlParserSupport;
@@ -62,7 +61,6 @@ public class TenantLineInnerInterceptor extends JsqlParserSupport implements Inn
     @Override
     @Override
     public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
     public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
         if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return;
         if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return;
-        if (SqlParserHelper.getSqlParserInfo(ms)) return;
         PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql);
         PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql);
         mpBs.sql(parserSingle(mpBs.sql(), null));
         mpBs.sql(parserSingle(mpBs.sql(), null));
     }
     }
@@ -74,7 +72,6 @@ public class TenantLineInnerInterceptor extends JsqlParserSupport implements Inn
         SqlCommandType sct = ms.getSqlCommandType();
         SqlCommandType sct = ms.getSqlCommandType();
         if (sct == SqlCommandType.INSERT || sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) {
         if (sct == SqlCommandType.INSERT || sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) {
             if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return;
             if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return;
-            if (SqlParserHelper.getSqlParserInfo(ms)) return;
             PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql();
             PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql();
             mpBs.sql(parserMulti(mpBs.sql(), null));
             mpBs.sql(parserMulti(mpBs.sql(), null));
         }
         }

+ 0 - 84
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/pagination/Page.java

@@ -17,7 +17,6 @@ package com.baomidou.mybatisplus.extension.plugins.pagination;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
@@ -71,10 +70,6 @@ public class Page<T> implements IPage<T> {
      * 是否进行 count 查询
      * 是否进行 count 查询
      */
      */
     protected boolean isSearchCount = true;
     protected boolean isSearchCount = true;
-    /**
-     * 是否命中count缓存
-     */
-    protected boolean hitCount = false;
     /**
     /**
      * countId
      * countId
      */
      */
@@ -241,71 +236,6 @@ public class Page<T> implements IPage<T> {
         return this;
         return this;
     }
     }
 
 
-    /**
-     * 设置需要进行正序排序的字段
-     * <p>
-     * Replaced:{@link #addOrder(OrderItem...)}
-     *
-     * @param ascs 字段
-     * @return 返回自身
-     * @deprecated 3.2.0
-     */
-    @Deprecated
-    public Page<T> setAscs(List<String> ascs) {
-        return CollectionUtils.isNotEmpty(ascs) ? setAsc(ascs.toArray(new String[0])) : this;
-    }
-
-    /**
-     * 升序
-     * <p>
-     * Replaced:{@link #addOrder(OrderItem...)}
-     *
-     * @param ascs 多个升序字段
-     * @deprecated 3.2.0
-     */
-    @Deprecated
-    public Page<T> setAsc(String... ascs) {
-        // 保证原来方法 set 的语意
-        removeOrder(OrderItem::isAsc);
-        for (String s : ascs) {
-            addOrder(OrderItem.asc(s));
-        }
-        return this;
-    }
-
-    /**
-     * Replaced:{@link #addOrder(OrderItem...)}
-     *
-     * @param descs 需要倒序排列的字段
-     * @return 自身
-     * @deprecated 3.2.0
-     */
-    @Deprecated
-    public Page<T> setDescs(List<String> descs) {
-        // 保证原来方法 set 的语意
-        if (CollectionUtils.isNotEmpty(descs)) {
-            removeOrder(item -> !item.isAsc());
-            for (String s : descs) {
-                addOrder(OrderItem.desc(s));
-            }
-        }
-        return this;
-    }
-
-    /**
-     * 降序,这方法名不知道是谁起的
-     * <p>
-     * Replaced:{@link #addOrder(OrderItem...)}
-     *
-     * @param descs 多个降序字段
-     * @deprecated 3.2.0
-     */
-    @Deprecated
-    public Page<T> setDesc(String... descs) {
-        setDescs(Arrays.asList(descs));
-        return this;
-    }
-
     @Override
     @Override
     public List<OrderItem> orders() {
     public List<OrderItem> orders() {
         return getOrders();
         return getOrders();
@@ -337,18 +267,4 @@ public class Page<T> implements IPage<T> {
         this.optimizeCountSql = optimizeCountSql;
         this.optimizeCountSql = optimizeCountSql;
         return this;
         return this;
     }
     }
-
-    @Override
-    public void hitCount(boolean hit) {
-        this.hitCount = hit;
-    }
-
-    public void setHitCount(boolean hit) {
-        this.hitCount = hit;
-    }
-
-    @Override
-    public boolean isHitCount() {
-        return hitCount;
-    }
 }
 }

+ 0 - 17
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/SqlHelper.java

@@ -140,23 +140,6 @@ public final class SqlHelper {
         return null;
         return null;
     }
     }
 
 
-    /**
-     * 清理缓存.
-     * 批量插入因为无法重用sqlSession,只能新开启一个sqlSession
-     *
-     * @param clazz 实体类
-     * @deprecated 3.3.1
-     */
-    @Deprecated
-    public static void clearCache(Class<?> clazz) {
-        SqlSessionFactory sqlSessionFactory = GlobalConfigUtils.currentSessionFactory(clazz);
-        SqlSessionHolder sqlSessionHolder = (SqlSessionHolder) TransactionSynchronizationManager.getResource(sqlSessionFactory);
-        if (sqlSessionHolder != null) {
-            SqlSession sqlSession = sqlSessionHolder.getSqlSession();
-            sqlSession.clearCache();
-        }
-    }
-
     /**
     /**
      * 执行批量操作
      * 执行批量操作
      *
      *

+ 0 - 30
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/SqlParserUtils.java

@@ -15,13 +15,6 @@
  */
  */
 package com.baomidou.mybatisplus.extension.toolkit;
 package com.baomidou.mybatisplus.extension.toolkit;
 
 
-import com.baomidou.mybatisplus.core.parser.ISqlParser;
-import com.baomidou.mybatisplus.core.parser.SqlInfo;
-import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
-import org.apache.ibatis.reflection.MetaObject;
-
-import java.util.Optional;
-
 /**
 /**
  * SQL 解析工具类
  * SQL 解析工具类
  *
  *
@@ -30,8 +23,6 @@ import java.util.Optional;
  */
  */
 public class SqlParserUtils {
 public class SqlParserUtils {
 
 
-    private static final ISqlParser COUNT_SQL_PARSER = new JsqlParserCountOptimize();
-
     /**
     /**
      * 获取 COUNT 原生 SQL 包装
      * 获取 COUNT 原生 SQL 包装
      *
      *
@@ -41,25 +32,4 @@ public class SqlParserUtils {
     public static String getOriginalCountSql(String originalSql) {
     public static String getOriginalCountSql(String originalSql) {
         return String.format("SELECT COUNT(*) FROM (%s) TOTAL", originalSql);
         return String.format("SELECT COUNT(*) FROM (%s) TOTAL", originalSql);
     }
     }
-
-    /**
-     * 获取CountOptimize
-     *
-     * @param optimizeCountSql 是否优化 Count SQL
-     * @param sqlParser        Count SQL 解析类
-     * @param originalSql      需要计算Count SQL
-     * @return SqlInfo
-     * @deprecated 3.4.0
-     */
-    @Deprecated
-    public static SqlInfo getOptimizeCountSql(boolean optimizeCountSql, ISqlParser sqlParser, String originalSql) {
-        return getOptimizeCountSql(optimizeCountSql, sqlParser, originalSql, null);
-    }
-
-    public static SqlInfo getOptimizeCountSql(boolean optimizeCountSql, ISqlParser sqlParser, String originalSql, MetaObject metaObject) {
-        if (optimizeCountSql) {
-            return Optional.ofNullable(sqlParser).orElseGet(() -> COUNT_SQL_PARSER).parser(metaObject, originalSql);
-        }
-        return SqlInfo.newInstance().setSql(getOriginalCountSql(originalSql));
-    }
 }
 }

+ 0 - 69
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/VersionUtils.java

@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011-2021, baomidou (jobob@qq.com).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.baomidou.mybatisplus.extension.toolkit;
-
-import com.baomidou.mybatisplus.core.toolkit.Assert;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-
-/**
- * VersionUtils,比较版本号
- *
- * @author Caratacus
- * @since 2016-12-5
- * @deprecated 3.4.1
- */
-@Deprecated
-public class VersionUtils {
-
-    /**
-     * 比较版本号的大小,前者大则返回一个正数,后者大返回一个负数,相等则返回0
-     *
-     * @param version1 ignore
-     * @param version2 ignore
-     * @return ignore
-     */
-    public static int compareVersion(String version1, String version2) {
-        Assert.isTrue(!StringUtils.isBlank(version1) && !StringUtils.isBlank(version2),
-            "Error: CompareVersion Error: Illegal Argument !");
-        // 切割点 ".";
-        String[] versionArray1 = version1.split("\\.");
-        String[] versionArray2 = version2.split("\\.");
-        int idx = 0;
-        // 取最小长度值
-        int minLength = Math.min(versionArray1.length, versionArray2.length);
-        int diff = 0;
-        // 先比较长度 再比较字符
-        while (idx < minLength && (diff = versionArray1[idx].length() - versionArray2[idx].length()) == 0
-            && (diff = versionArray1[idx].compareTo(versionArray2[idx])) == 0) {
-            ++idx;
-        }
-        // 如果已经分出大小,则直接返回,如果未分出大小,则再比较位数,有子版本的为大;
-        diff = (diff != 0) ? diff : versionArray1.length - versionArray2.length;
-        return diff;
-    }
-
-    /**
-     * 比较版本号 true
-     *
-     * @param version1 ignore
-     * @param version2 ignore
-     * @return boolean true v1 &gt;= v2 false 相反
-     */
-    public static boolean compare(String version1, String version2) {
-        int num = compareVersion(version1, version2);
-        return num >= 0;
-    }
-}

+ 56 - 56
mybatis-plus-extension/src/test/java/com/baomidou/mybatisplus/test/handlers/MybatisEnumTypeHandlerTest.java

@@ -33,42 +33,13 @@ import static org.mockito.Mockito.when;
 
 
 @ExtendWith(MockitoExtension.class)
 @ExtendWith(MockitoExtension.class)
 public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
 public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
-    
+
     private static final MybatisEnumTypeHandler<SexEnum> SEX_ENUM_ENUM_TYPE_HANDLER = new MybatisEnumTypeHandler<>(SexEnum.class);
     private static final MybatisEnumTypeHandler<SexEnum> SEX_ENUM_ENUM_TYPE_HANDLER = new MybatisEnumTypeHandler<>(SexEnum.class);
-    
+
     private static final MybatisEnumTypeHandler<GradeEnum> GRADE_ENUM_ENUM_TYPE_HANDLER = new MybatisEnumTypeHandler<>(GradeEnum.class);
     private static final MybatisEnumTypeHandler<GradeEnum> GRADE_ENUM_ENUM_TYPE_HANDLER = new MybatisEnumTypeHandler<>(GradeEnum.class);
-    
+
     private static final MybatisEnumTypeHandler<CharacterEnum> CHARACTER_ENUM_MYBATIS_ENUM_TYPE_HANDLER = new MybatisEnumTypeHandler<>(CharacterEnum.class);
     private static final MybatisEnumTypeHandler<CharacterEnum> CHARACTER_ENUM_MYBATIS_ENUM_TYPE_HANDLER = new MybatisEnumTypeHandler<>(CharacterEnum.class);
-    
-    @Getter
-    @AllArgsConstructor
-    enum SexEnum implements IEnum<Integer> {
-        
-        MAN(1, "1"),
-        WO_MAN(2, "2");
-        Integer code;
-        String desc;
-        
-        @Override
-        public Integer getValue() {
-            return this.code;
-        }
-    }
-    
-    @Getter
-    @AllArgsConstructor
-    enum GradeEnum {
-        
-        PRIMARY(1, "小学"),
-        SECONDARY(2, "中学"),
-        HIGH(3, "高中");
-        
-        @EnumValue
-        private final int code;
-        
-        private final String desc;
-    }
-    
+
     @Test
     @Test
     @Override
     @Override
     public void getResultFromResultSetByColumnName() throws Exception {
     public void getResultFromResultSetByColumnName() throws Exception {
@@ -78,14 +49,14 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         assertEquals(SexEnum.MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertEquals(SexEnum.MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         when(resultSet.getObject("column", Integer.class)).thenReturn(2);
         when(resultSet.getObject("column", Integer.class)).thenReturn(2);
         assertEquals(SexEnum.WO_MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertEquals(SexEnum.WO_MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
-        
+
         when(resultSet.getObject("column", Integer.class)).thenReturn(null);
         when(resultSet.getObject("column", Integer.class)).thenReturn(null);
         assertNull(GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertNull(GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         when(resultSet.getObject("column", Integer.class)).thenReturn(1);
         when(resultSet.getObject("column", Integer.class)).thenReturn(1);
         assertEquals(GradeEnum.PRIMARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertEquals(GradeEnum.PRIMARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         when(resultSet.getObject("column", Integer.class)).thenReturn(2);
         when(resultSet.getObject("column", Integer.class)).thenReturn(2);
         assertEquals(GradeEnum.SECONDARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertEquals(GradeEnum.SECONDARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
-        
+
         when(resultSet.getObject("column", Character.class)).thenReturn(null);
         when(resultSet.getObject("column", Character.class)).thenReturn(null);
         assertNull(CHARACTER_ENUM_MYBATIS_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertNull(CHARACTER_ENUM_MYBATIS_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         when(resultSet.getObject("column", Character.class)).thenReturn('1');
         when(resultSet.getObject("column", Character.class)).thenReturn('1');
@@ -93,17 +64,17 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         when(resultSet.getObject("column", Character.class)).thenReturn('2');
         when(resultSet.getObject("column", Character.class)).thenReturn('2');
         assertEquals(CharacterEnum.WO_MAN, CHARACTER_ENUM_MYBATIS_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
         assertEquals(CharacterEnum.WO_MAN, CHARACTER_ENUM_MYBATIS_ENUM_TYPE_HANDLER.getResult(resultSet, "column"));
     }
     }
-    
+
     @Test
     @Test
     void dealEnumType() {
     void dealEnumType() {
-        Assertions.assertFalse(MybatisEnumTypeHandler.dealEnumType(String.class).isPresent());
-        Assertions.assertTrue(MybatisEnumTypeHandler.dealEnumType(GradeEnum.class).isPresent());
-        Assertions.assertFalse(MybatisEnumTypeHandler.dealEnumType(SexEnum.class).isPresent());
+        Assertions.assertFalse(MybatisEnumTypeHandler.findEnumValueFieldName(String.class).isPresent());
+        Assertions.assertTrue(MybatisEnumTypeHandler.findEnumValueFieldName(GradeEnum.class).isPresent());
+        Assertions.assertFalse(MybatisEnumTypeHandler.findEnumValueFieldName(SexEnum.class).isPresent());
         Assertions.assertFalse(MybatisEnumTypeHandler.findEnumValueFieldName(String.class).isPresent());
         Assertions.assertFalse(MybatisEnumTypeHandler.findEnumValueFieldName(String.class).isPresent());
         Assertions.assertTrue(MybatisEnumTypeHandler.findEnumValueFieldName(GradeEnum.class).isPresent());
         Assertions.assertTrue(MybatisEnumTypeHandler.findEnumValueFieldName(GradeEnum.class).isPresent());
         Assertions.assertFalse(MybatisEnumTypeHandler.findEnumValueFieldName(SexEnum.class).isPresent());
         Assertions.assertFalse(MybatisEnumTypeHandler.findEnumValueFieldName(SexEnum.class).isPresent());
     }
     }
-    
+
     @Test
     @Test
     @Override
     @Override
     public void setParameter() throws Exception {
     public void setParameter() throws Exception {
@@ -113,7 +84,7 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         verify(preparedStatement).setObject(2, 2);
         verify(preparedStatement).setObject(2, 2);
         SEX_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 3, null, JdbcType.INTEGER);
         SEX_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 3, null, JdbcType.INTEGER);
         verify(preparedStatement).setNull(3, JdbcType.INTEGER.TYPE_CODE);
         verify(preparedStatement).setNull(3, JdbcType.INTEGER.TYPE_CODE);
-        
+
         GRADE_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 4, GradeEnum.PRIMARY, null);
         GRADE_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 4, GradeEnum.PRIMARY, null);
         verify(preparedStatement).setObject(4, 1);
         verify(preparedStatement).setObject(4, 1);
         GRADE_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 5, GradeEnum.SECONDARY, null);
         GRADE_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 5, GradeEnum.SECONDARY, null);
@@ -121,18 +92,7 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         GRADE_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 6, null, JdbcType.INTEGER);
         GRADE_ENUM_ENUM_TYPE_HANDLER.setParameter(preparedStatement, 6, null, JdbcType.INTEGER);
         verify(preparedStatement).setNull(6, JdbcType.INTEGER.TYPE_CODE);
         verify(preparedStatement).setNull(6, JdbcType.INTEGER.TYPE_CODE);
     }
     }
-    
-    @Getter
-    @AllArgsConstructor
-    enum CharacterEnum {
-        MAN('1', "男"),
-        WO_MAN('2', "女");
-        
-        @EnumValue
-        char code;
-        String desc;
-    }
-    
+
     @Test
     @Test
     @Override
     @Override
     public void getResultFromResultSetByColumnIndex() throws Exception {
     public void getResultFromResultSetByColumnIndex() throws Exception {
@@ -142,7 +102,7 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         assertEquals(SexEnum.WO_MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 2));
         assertEquals(SexEnum.WO_MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 2));
         when(resultSet.getObject(3, Integer.class)).thenReturn(null);
         when(resultSet.getObject(3, Integer.class)).thenReturn(null);
         assertNull(SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 3));
         assertNull(SEX_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 3));
-        
+
         when(resultSet.getObject(4, Integer.class)).thenReturn(1);
         when(resultSet.getObject(4, Integer.class)).thenReturn(1);
         assertEquals(GradeEnum.PRIMARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 4));
         assertEquals(GradeEnum.PRIMARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 4));
         when(resultSet.getObject(5, Integer.class)).thenReturn(2);
         when(resultSet.getObject(5, Integer.class)).thenReturn(2);
@@ -150,7 +110,7 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         when(resultSet.getObject(6, Integer.class)).thenReturn(null);
         when(resultSet.getObject(6, Integer.class)).thenReturn(null);
         assertNull(GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 6));
         assertNull(GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(resultSet, 6));
     }
     }
-    
+
     @Test
     @Test
     @Override
     @Override
     public void getResultFromCallableStatement() throws Exception {
     public void getResultFromCallableStatement() throws Exception {
@@ -160,7 +120,7 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         assertEquals(SexEnum.WO_MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 2));
         assertEquals(SexEnum.WO_MAN, SEX_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 2));
         when(callableStatement.getObject(3, Integer.class)).thenReturn(null);
         when(callableStatement.getObject(3, Integer.class)).thenReturn(null);
         assertNull(SEX_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 3));
         assertNull(SEX_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 3));
-        
+
         when(callableStatement.getObject(4, Integer.class)).thenReturn(1);
         when(callableStatement.getObject(4, Integer.class)).thenReturn(1);
         assertEquals(GradeEnum.PRIMARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 4));
         assertEquals(GradeEnum.PRIMARY, GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 4));
         when(callableStatement.getObject(5, Integer.class)).thenReturn(2);
         when(callableStatement.getObject(5, Integer.class)).thenReturn(2);
@@ -168,4 +128,44 @@ public class MybatisEnumTypeHandlerTest extends BaseTypeHandlerTest {
         when(callableStatement.getObject(6, Integer.class)).thenReturn(null);
         when(callableStatement.getObject(6, Integer.class)).thenReturn(null);
         assertNull(GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 6));
         assertNull(GRADE_ENUM_ENUM_TYPE_HANDLER.getResult(callableStatement, 6));
     }
     }
+
+    @Getter
+    @AllArgsConstructor
+    enum SexEnum implements IEnum<Integer> {
+
+        MAN(1, "1"),
+        WO_MAN(2, "2");
+        Integer code;
+        String desc;
+
+        @Override
+        public Integer getValue() {
+            return this.code;
+        }
+    }
+
+    @Getter
+    @AllArgsConstructor
+    enum GradeEnum {
+
+        PRIMARY(1, "小学"),
+        SECONDARY(2, "中学"),
+        HIGH(3, "高中");
+
+        @EnumValue
+        private final int code;
+
+        private final String desc;
+    }
+
+    @Getter
+    @AllArgsConstructor
+    enum CharacterEnum {
+        MAN('1', "男"),
+        WO_MAN('2', "女");
+
+        @EnumValue
+        char code;
+        String desc;
+    }
 }
 }

+ 0 - 1
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/BaseDbTest.java

@@ -65,7 +65,6 @@ public abstract class BaseDbTest<T> extends TypeReference<T> {
         MybatisSqlSessionFactoryBuilder builder = new MybatisSqlSessionFactoryBuilder();
         MybatisSqlSessionFactoryBuilder builder = new MybatisSqlSessionFactoryBuilder();
         Environment environment = new Environment("test", new ManagedTransactionFactory(), ds);
         Environment environment = new Environment("test", new ManagedTransactionFactory(), ds);
         MybatisConfiguration configuration = new MybatisConfiguration(environment);
         MybatisConfiguration configuration = new MybatisConfiguration(environment);
-        configuration.setUseDeprecatedExecutor(false);
         if (consumer != null) {
         if (consumer != null) {
             consumer.accept(configuration);
             consumer.accept(configuration);
         }
         }

+ 4 - 7
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/PageTest.java

@@ -14,14 +14,13 @@ import java.util.Collections;
  * @author nieqiurong 2020/3/20.
  * @author nieqiurong 2020/3/20.
  */
  */
 class PageTest {
 class PageTest {
-  
+
     @Test
     @Test
     void testCopy(){
     void testCopy(){
         Page page1 = new Page(2, 10, 100, false);
         Page page1 = new Page(2, 10, 100, false);
         page1.setOptimizeCountSql(false);
         page1.setOptimizeCountSql(false);
-        page1.hitCount(true);
         page1.setOrders(Collections.singletonList(OrderItem.asc("test")));
         page1.setOrders(Collections.singletonList(OrderItem.asc("test")));
-        
+
         Page page2 = new Page();
         Page page2 = new Page();
         PropertyCopier.copyBeanProperties(Page.class, page1, page2);
         PropertyCopier.copyBeanProperties(Page.class, page1, page2);
         Assertions.assertEquals(page1.getCurrent(), page2.getCurrent());
         Assertions.assertEquals(page1.getCurrent(), page2.getCurrent());
@@ -29,7 +28,6 @@ class PageTest {
         Assertions.assertEquals(page1.getSize(), page2.getSize());
         Assertions.assertEquals(page1.getSize(), page2.getSize());
         Assertions.assertEquals(page1.optimizeCountSql(), page2.optimizeCountSql());
         Assertions.assertEquals(page1.optimizeCountSql(), page2.optimizeCountSql());
         Assertions.assertEquals(page1.isSearchCount(), page2.isSearchCount());
         Assertions.assertEquals(page1.isSearchCount(), page2.isSearchCount());
-        Assertions.assertEquals(page1.isHitCount(), page2.isHitCount());
         Assertions.assertEquals(page1.getOrders().size(), page2.getOrders().size());
         Assertions.assertEquals(page1.getOrders().size(), page2.getOrders().size());
 
 
         Page page3 = new Page();
         Page page3 = new Page();
@@ -39,9 +37,8 @@ class PageTest {
         Assertions.assertEquals(page1.getSize(), page3.getSize());
         Assertions.assertEquals(page1.getSize(), page3.getSize());
         Assertions.assertEquals(page1.optimizeCountSql(), page3.optimizeCountSql());
         Assertions.assertEquals(page1.optimizeCountSql(), page3.optimizeCountSql());
         Assertions.assertEquals(page1.isSearchCount(), page3.isSearchCount());
         Assertions.assertEquals(page1.isSearchCount(), page3.isSearchCount());
-        Assertions.assertEquals(page1.isHitCount(), page3.isHitCount());
         Assertions.assertEquals(page1.getOrders().size(), page3.getOrders().size());
         Assertions.assertEquals(page1.getOrders().size(), page3.getOrders().size());
-    
+
         Page page4 = new Page();
         Page page4 = new Page();
         BeanCopier.create(page1.getClass(), page4.getClass(), false).copy(page1, page4, null);
         BeanCopier.create(page1.getClass(), page4.getClass(), false).copy(page1, page4, null);
         //链式的set方法会导致属性BeanCopier的拷贝方法失败  https://github.com/cglib/cglib/issues/108.
         //链式的set方法会导致属性BeanCopier的拷贝方法失败  https://github.com/cglib/cglib/issues/108.
@@ -51,5 +48,5 @@ class PageTest {
         Assertions.assertEquals(1, page4.orders().size());
         Assertions.assertEquals(1, page4.orders().size());
         Assertions.assertEquals(10, page4.getSize());
         Assertions.assertEquals(10, page4.getSize());
     }
     }
-    
+
 }
 }

+ 0 - 1
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/cache/CacheConfig.java

@@ -38,7 +38,6 @@ public class CacheConfig {
         MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
         MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
         sqlSessionFactory.setDataSource(dataSource);
         sqlSessionFactory.setDataSource(dataSource);
         MybatisConfiguration configuration = new MybatisConfiguration();
         MybatisConfiguration configuration = new MybatisConfiguration();
-        configuration.setUseDeprecatedExecutor(false);
         configuration.setJdbcTypeForNull(JdbcType.NULL);
         configuration.setJdbcTypeForNull(JdbcType.NULL);
         configuration.setMapUnderscoreToCamelCase(true);
         configuration.setMapUnderscoreToCamelCase(true);
         configuration.setDefaultExecutorType(ExecutorType.REUSE);
         configuration.setDefaultExecutorType(ExecutorType.REUSE);

+ 1 - 1
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/idgenerator/model/StringIdGeneratorModel.java

@@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
 @TableName(value = "t_id_generator_string")
 @TableName(value = "t_id_generator_string")
 public class StringIdGeneratorModel {
 public class StringIdGeneratorModel {
 
 
-    @TableId(type = IdType.UUID)
+    @TableId(type = IdType.ASSIGN_UUID)
     private String id;
     private String id;
 
 
     private String name;
     private String name;

+ 0 - 4
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/mapper/commons/CommonDataMapper.java

@@ -15,7 +15,6 @@
  */
  */
 package com.baomidou.mybatisplus.test.mysql.mapper.commons;
 package com.baomidou.mybatisplus.test.mysql.mapper.commons;
 
 
-import com.baomidou.mybatisplus.annotation.SqlParser;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -31,14 +30,11 @@ import java.util.Optional;
  * @author miemie
  * @author miemie
  * @since 2018/6/7
  * @since 2018/6/7
  */
  */
-@SqlParser
 public interface CommonDataMapper extends MyBaseMapper<CommonData> {
 public interface CommonDataMapper extends MyBaseMapper<CommonData> {
 
 
-    @SqlParser(filter = true)
     @Select("select * from common_data")
     @Select("select * from common_data")
     List<CommonData> getAllNoTenant();
     List<CommonData> getAllNoTenant();
 
 
-    @SqlParser
     @Select("select * from common_data ${ew.customSqlSegment}")
     @Select("select * from common_data ${ew.customSqlSegment}")
     List<CommonData> getByWrapper(@Param(Constants.WRAPPER) Wrapper wrapper);
     List<CommonData> getByWrapper(@Param(Constants.WRAPPER) Wrapper wrapper);
 
 

+ 0 - 3
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/mysql/mapper/commons/ResultMapEntityMapper.java

@@ -15,7 +15,6 @@
  */
  */
 package com.baomidou.mybatisplus.test.mysql.mapper.commons;
 package com.baomidou.mybatisplus.test.mysql.mapper.commons;
 
 
-import com.baomidou.mybatisplus.annotation.SqlParser;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.test.mysql.MyBaseMapper;
 import com.baomidou.mybatisplus.test.mysql.MyBaseMapper;
@@ -33,12 +32,10 @@ import java.io.Serializable;
 public interface ResultMapEntityMapper extends MyBaseMapper<ResultMapEntity> {
 public interface ResultMapEntityMapper extends MyBaseMapper<ResultMapEntity> {
 
 
     @Override
     @Override
-    @SqlParser
     @ResultMap("resultChildren1")
     @ResultMap("resultChildren1")
     @Select("select * from result_map_entity where id = #{id}")
     @Select("select * from result_map_entity where id = #{id}")
     ResultMapEntity selectById(Serializable id);
     ResultMapEntity selectById(Serializable id);
 
 
     @Override
     @Override
-    @SqlParser
     ResultMapEntity selectOne(@Param(Constants.WRAPPER) Wrapper<ResultMapEntity> queryWrapper);
     ResultMapEntity selectOne(@Param(Constants.WRAPPER) Wrapper<ResultMapEntity> queryWrapper);
 }
 }

+ 1 - 1
mybatis-plus/src/test/resources/mybatis-config.xml

@@ -6,7 +6,7 @@
 
 
     <settings>
     <settings>
         <setting name="defaultEnumTypeHandler"
         <setting name="defaultEnumTypeHandler"
-                 value="com.baomidou.mybatisplus.extension.handlers.MybatisEnumTypeHandler"/>
+                 value="com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler"/>
     </settings>
     </settings>
 
 
     <mappers>
     <mappers>