Skip to content

Commit 1bc4dbe

Browse files
committed
Update to MyBatis 3.5.17
* multipleResultSetsEnabled deprecated
1 parent b577c87 commit 1bc4dbe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/MybatisProperties.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2023 the original author or authors.
2+
* Copyright 2015-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@
3333
import org.apache.ibatis.type.JdbcType;
3434
import org.apache.ibatis.type.TypeHandler;
3535
import org.springframework.boot.context.properties.ConfigurationProperties;
36+
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
3637
import org.springframework.boot.context.properties.PropertyMapper;
3738
import org.springframework.core.io.Resource;
3839
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
@@ -446,6 +447,7 @@ public void setAggressiveLazyLoading(Boolean aggressiveLazyLoading) {
446447
this.aggressiveLazyLoading = aggressiveLazyLoading;
447448
}
448449

450+
@DeprecatedConfigurationProperty(since = "3.0.4", reason = "The option is not used at MyBatis core module. It will be removed in the future. See https://github.com/mybatis/mybatis-3/pull/3238")
449451
public Boolean getMultipleResultSetsEnabled() {
450452
return multipleResultSetsEnabled;
451453
}

mybatis-spring-boot-autoconfigure/src/test/java/org/mybatis/spring/boot/autoconfigure/MybatisPropertiesTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ void testWithCustomizeCoreConfiguration() {
139139
.withPropertyValues("mybatis.configuration.aggressive-lazy-loading:true")
140140
.run(context -> assertThat(
141141
context.getBean(SqlSessionFactory.class).getConfiguration().isAggressiveLazyLoading()).isTrue()),
142+
// Since MyBatis 3.5.17, the return value of isMultipleResultSetsEnabled() is always true
143+
// See https://github.com/mybatis/mybatis-3/pull/3238
142144
() -> this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
143145
.withPropertyValues("mybatis.configuration.multiple-result-sets-enabled:false")
144146
.run(context -> assertThat(
145-
context.getBean(SqlSessionFactory.class).getConfiguration().isMultipleResultSetsEnabled()).isFalse()),
147+
context.getBean(SqlSessionFactory.class).getConfiguration().isMultipleResultSetsEnabled()).isTrue()),
146148
() -> this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
147149
.withPropertyValues("mybatis.configuration.use-generated-keys:true")
148150
.run(context -> assertThat(context.getBean(SqlSessionFactory.class).getConfiguration().isUseGeneratedKeys())

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<java.version>17</java.version>
7373
<java.release.version>17</java.release.version>
7474

75-
<mybatis.version>3.5.16</mybatis.version>
75+
<mybatis.version>3.5.17</mybatis.version>
7676
<mybatis-spring.version>3.0.4</mybatis-spring.version>
7777
<mybatis-freemarker.version>1.3.0</mybatis-freemarker.version>
7878
<mybatis-velocity.version>2.3.0</mybatis-velocity.version>

0 commit comments

Comments
 (0)