From ca6d148a1b48195a359a3ab29d449229a87dd05a Mon Sep 17 00:00:00 2001 From: BaoLiang <29528966+lenboo@users.noreply.github.com> Date: Fri, 25 Feb 2022 08:31:12 +0800 Subject: [PATCH] upgrade mybatis-plus to 3.4.3 (#8515) --- .../dao/datasource/SpringConnectionFactory.java | 16 ++++++++-------- dolphinscheduler-dist/release-docs/LICENSE | 16 ++++++++-------- pom.xml | 4 ++-- tools/dependencies/known-dependencies.txt | 16 ++++++++-------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java index 516e16ad42..600a062f3d 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java @@ -35,17 +35,14 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.core.MybatisConfiguration; import com.baomidou.mybatisplus.core.config.GlobalConfig; -import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.baomidou.mybatisplus.extension.MybatisMapWrapperFactory; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; @Configuration public class SpringConnectionFactory { - @Bean - public PaginationInterceptor paginationInterceptor() { - return new PaginationInterceptor(); - } - @Bean public DataSourceTransactionManager transactionManager(DataSource dataSource) { return new DataSourceTransactionManager(dataSource); @@ -58,12 +55,15 @@ public class SpringConnectionFactory { configuration.setCacheEnabled(false); configuration.setCallSettersOnNulls(true); configuration.setJdbcTypeForNull(JdbcType.NULL); - configuration.addInterceptor(paginationInterceptor()); + configuration.setObjectWrapperFactory(new MybatisMapWrapperFactory()); + + MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor(); + mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor()); - configuration.setGlobalConfig(new GlobalConfig().setBanner(false)); MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean(); sqlSessionFactoryBean.setConfiguration(configuration); sqlSessionFactoryBean.setDataSource(dataSource); + sqlSessionFactoryBean.setPlugins(mybatisPlusInterceptor); GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig(); dbConfig.setIdType(IdType.AUTO); diff --git a/dolphinscheduler-dist/release-docs/LICENSE b/dolphinscheduler-dist/release-docs/LICENSE index cd605d7557..e43c164532 100644 --- a/dolphinscheduler-dist/release-docs/LICENSE +++ b/dolphinscheduler-dist/release-docs/LICENSE @@ -323,7 +323,7 @@ The text of each license is also included at licenses/LICENSE-[project].txt. jna-platform 5.10.0: https://mvnrepository.com/artifact/net.java.dev.jna/jna-platform/5.10.0, Apache 2.0 and LGPL 2.1 joda-time 2.10.13: https://github.com/JodaOrg/joda-time, Apache 2.0 jpam 1.1: https://mvnrepository.com/artifact/net.sf.jpam/jpam/1.1, Apache 2.0 - jsqlparser 2.1: https://github.com/JSQLParser/JSqlParser, Apache 2.0 or LGPL 2.1 + jsqlparser 4.0: https://github.com/JSQLParser/JSqlParser, Apache 2.0 or LGPL 2.1 jsr305 3.0.0: https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305, Apache 2.0 j2objc-annotations 1.1 https://mvnrepository.com/artifact/com.google.j2objc/j2objc-annotations/1.1, Apache 2.0 libfb303 0.9.3: https://mvnrepository.com/artifact/org.apache.thrift/libfb303/0.9.3, Apache 2.0 @@ -334,13 +334,13 @@ The text of each license is also included at licenses/LICENSE-[project].txt. log4j-1.2-api 2.14.1: https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-1.2-api/2.14.1, Apache 2.0 lz4 1.3.0: https://mvnrepository.com/artifact/net.jpountz.lz4/lz4/1.3.0, Apache 2.0 mapstruct 1.2.0.Final: https://github.com/mapstruct/mapstruct, Apache 2.0 - mybatis 3.5.2 https://mvnrepository.com/artifact/org.mybatis/mybatis/3.5.2, Apache 2.0 - mybatis-plus 3.2.0: https://github.com/baomidou/mybatis-plus, Apache 2.0 - mybatis-plus-annotation 3.2.0: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-annotation/3.2.0, Apache 2.0 - mybatis-plus-boot-starter 3.2.0: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter/3.2.0, Apache 2.0 - mybatis-plus-core 3.2.0: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-core/3.2.0, Apache 2.0 - mybatis-plus-extension 3.2.0: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-extension/3.2.0, Apache 2.0 - mybatis-spring 2.0.2: https://mvnrepository.com/artifact/org.mybatis/mybatis-spring/2.0.2, Apache 2.0 + mybatis 3.5.7 https://mvnrepository.com/artifact/org.mybatis/mybatis/3.5.7, Apache 2.0 + mybatis-plus 3.4.3: https://github.com/baomidou/mybatis-plus, Apache 2.0 + mybatis-plus-annotation 3.4.3: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-annotation/3.4.3, Apache 2.0 + mybatis-plus-boot-starter 3.4.3: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter/3.4.3, Apache 2.0 + mybatis-plus-core 3.4.3: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-core/3.4.3, Apache 2.0 + mybatis-plus-extension 3.4.3: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-extension/3.4.3, Apache 2.0 + mybatis-spring 2.0.6: https://mvnrepository.com/artifact/org.mybatis/mybatis-spring/2.0.6, Apache 2.0 netty 3.6.2.Final: https://github.com/netty/netty, Apache 2.0 netty 4.1.53.Final: https://github.com/netty/netty/blob/netty-4.1.53.Final/LICENSE.txt, Apache 2.0 opencsv 2.3: https://mvnrepository.com/artifact/net.sf.opencsv/opencsv/2.3, Apache 2.0 diff --git a/pom.xml b/pom.xml index cbc7e21b00..bd5852c61d 100644 --- a/pom.xml +++ b/pom.xml @@ -60,8 +60,8 @@ 2.7.3 2.3.2 2.10.5 - 3.2.0 - 2.0.1 + 3.4.3 + 2.0.6 9.1.3 1.2.4 1.4.200 diff --git a/tools/dependencies/known-dependencies.txt b/tools/dependencies/known-dependencies.txt index eba373d9f5..081da84346 100755 --- a/tools/dependencies/known-dependencies.txt +++ b/tools/dependencies/known-dependencies.txt @@ -143,7 +143,7 @@ joda-time-2.10.13.jar jpam-1.1.jar jsch-0.1.42.jar jsp-api-2.1.jar -jsqlparser-2.1.jar +jsqlparser-4.0.jar jsr305-3.0.0.jar jta-1.1.jar jul-to-slf4j-1.7.32.jar @@ -159,13 +159,13 @@ mapstruct-1.2.0.Final.jar micrometer-core-1.7.5.jar micrometer-registry-prometheus-1.7.5.jar mssql-jdbc-6.1.0.jre8.jar -mybatis-3.5.2.jar -mybatis-plus-3.2.0.jar -mybatis-plus-annotation-3.2.0.jar -mybatis-plus-boot-starter-3.2.0.jar -mybatis-plus-core-3.2.0.jar -mybatis-plus-extension-3.2.0.jar -mybatis-spring-2.0.2.jar +mybatis-3.5.7.jar +mybatis-plus-3.4.3.jar +mybatis-plus-annotation-3.4.3.jar +mybatis-plus-boot-starter-3.4.3.jar +mybatis-plus-core-3.4.3.jar +mybatis-plus-extension-3.4.3.jar +mybatis-spring-2.0.6.jar netty-3.6.2.Final.jar netty-all-4.1.53.Final.jar opencsv-2.3.jar