Skip to content

Commit b4ae220

Browse files
authored
Merge pull request #3238 from harawata/3234-deprecate-unused-setting
Deprecate unused setting `multipleResultSetsEnabled`
2 parents 5ded7bc + bc77b9d commit b4ae220

File tree

20 files changed

+33
-48
lines changed

20 files changed

+33
-48
lines changed

src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-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.
@@ -267,7 +267,6 @@ private void settingsElement(Properties props) {
267267
configuration.setProxyFactory((ProxyFactory) createInstance(props.getProperty("proxyFactory")));
268268
configuration.setLazyLoadingEnabled(booleanValueOf(props.getProperty("lazyLoadingEnabled"), false));
269269
configuration.setAggressiveLazyLoading(booleanValueOf(props.getProperty("aggressiveLazyLoading"), false));
270-
configuration.setMultipleResultSetsEnabled(booleanValueOf(props.getProperty("multipleResultSetsEnabled"), true));
271270
configuration.setUseColumnLabel(booleanValueOf(props.getProperty("useColumnLabel"), true));
272271
configuration.setUseGeneratedKeys(booleanValueOf(props.getProperty("useGeneratedKeys"), false));
273272
configuration.setDefaultExecutorType(ExecutorType.valueOf(props.getProperty("defaultExecutorType", "SIMPLE")));

src/main/java/org/apache/ibatis/session/Configuration.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public class Configuration {
108108
protected boolean safeResultHandlerEnabled = true;
109109
protected boolean mapUnderscoreToCamelCase;
110110
protected boolean aggressiveLazyLoading;
111-
protected boolean multipleResultSetsEnabled = true;
112111
protected boolean useGeneratedKeys;
113112
protected boolean useColumnLabel = true;
114113
protected boolean cacheEnabled = true;
@@ -456,12 +455,20 @@ public void setAggressiveLazyLoading(boolean aggressiveLazyLoading) {
456455
this.aggressiveLazyLoading = aggressiveLazyLoading;
457456
}
458457

458+
/**
459+
* @deprecated You can safely remove the call to this method as this option had no effect.
460+
*/
461+
@Deprecated
459462
public boolean isMultipleResultSetsEnabled() {
460-
return multipleResultSetsEnabled;
463+
return true;
461464
}
462465

466+
/**
467+
* @deprecated You can safely remove the call to this method as this option had no effect.
468+
*/
469+
@Deprecated
463470
public void setMultipleResultSetsEnabled(boolean multipleResultSetsEnabled) {
464-
this.multipleResultSetsEnabled = multipleResultSetsEnabled;
471+
// nop
465472
}
466473

467474
public Set<String> getLazyLoadTriggerMethods() {

src/site/es/xdoc/configuration.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
187187
</tr>
188188
<tr>
189189
<td>
190-
multipleResultSetsEnabled
191-
</td>
192-
<td>Habilita o inhabilita la obtención de múltiples ResultSets con una sola sentencia (se requiere un driver compatible)
190+
<strike>multipleResultSetsEnabled</strike>
193191
</td>
192+
<td>Deprecated. This option has no effect.</td>
194193
<td>
195194
true | false
196195
</td>
@@ -615,7 +614,6 @@ A continuación se muestra un ejemplo del elemento settings al completo:
615614
<setting name="cacheEnabled" value="true"/>
616615
<setting name="lazyLoadingEnabled" value="true"/>
617616
<setting name="aggressiveLazyLoading" value="true"/>
618-
<setting name="multipleResultSetsEnabled" value="true"/>
619617
<setting name="useColumnLabel" value="true"/>
620618
<setting name="useGeneratedKeys" value="false"/>
621619
<setting name="autoMappingBehavior" value="PARTIAL"/>

src/site/ja/xdoc/configuration.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
200200
</tr>
201201
<tr>
202202
<td>
203-
multipleResultSetsEnabled
203+
<strike>multipleResultSetsEnabled</strike>
204204
</td>
205205
<td>
206-
1つのステートメントから複数の ResultSet を返すことを許可するかどうかを指定します(複数 ResultSet に対応したドライバが必要です)
206+
非推奨。この設定は何の効果もありません
207207
</td>
208208
<td>
209209
true | false
@@ -639,7 +639,6 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
639639
<setting name="cacheEnabled" value="true"/>
640640
<setting name="lazyLoadingEnabled" value="true"/>
641641
<setting name="aggressiveLazyLoading" value="true"/>
642-
<setting name="multipleResultSetsEnabled" value="true"/>
643642
<setting name="useColumnLabel" value="true"/>
644643
<setting name="useGeneratedKeys" value="false"/>
645644
<setting name="autoMappingBehavior" value="PARTIAL"/>

src/site/ko/xdoc/configuration.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
179179
</tr>
180180
<tr>
181181
<td>
182-
multipleResultSetsEnabled
182+
<strike>multipleResultSetsEnabled</strike>
183183
</td>
184-
<td>한 개의 구문에서 여러 개의 ResultSet을 허용할지의 여부(드라이버가 해당 기능을 지원해야 함) </td>
184+
<td>Deprecated. This option has no effect.</td>
185185
<td>
186186
true | false
187187
</td>
@@ -620,7 +620,6 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
620620
<setting name="cacheEnabled" value="true"/>
621621
<setting name="lazyLoadingEnabled" value="true"/>
622622
<setting name="aggressiveLazyLoading" value="true"/>
623-
<setting name="multipleResultSetsEnabled" value="true"/>
624623
<setting name="useColumnLabel" value="true"/>
625624
<setting name="useGeneratedKeys" value="false"/>
626625
<setting name="autoMappingBehavior" value="PARTIAL"/>

src/site/markdown/configuration.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ These are extremely important tweaks that modify the way that MyBatis behaves at
108108
| cacheEnabled | Globally enables or disables any caches configured in any mapper under this configuration. | true &#124; false | true |
109109
| lazyLoadingEnabled | Globally enables or disables lazy loading. When enabled, all relations will be lazily loaded. This value can be superseded for a specific relation by using the `fetchType` attribute on it. | true &#124; false | false |
110110
| aggressiveLazyLoading | When enabled, any method call will load all the lazy properties of the object. Otherwise, each property is loaded on demand (see also `lazyLoadTriggerMethods`). | true &#124; false | false (true in ≤3.4.1) |
111-
| multipleResultSetsEnabled | Allows or disallows multiple ResultSets to be returned from a single statement (compatible driver required). | true &#124; false | true |
111+
| ~~multipleResultSetsEnabled~~ | Deprecated. This option has no effect. | true &#124; false | true |
112112
| useColumnLabel | Uses the column label instead of the column name. Different drivers behave differently in this respect. Refer to the driver documentation, or test out both modes to determine how your driver behaves. | true &#124; false | true |
113113
| useGeneratedKeys | Allows JDBC support for generated keys. A compatible driver is required. This setting forces generated keys to be used if set to true, as some drivers deny compatibility but still work (e.g. Derby). | true &#124; false | False |
114114
| autoMappingBehavior | Specifies if and how MyBatis should automatically map columns to fields/properties. NONE disables auto-mapping. PARTIAL will only auto-map results with no nested result mappings defined inside. FULL will auto-map result mappings of any complexity (containing nested or otherwise). | NONE, PARTIAL, FULL | PARTIAL |
@@ -145,7 +145,6 @@ An example of the settings element fully configured is as follows:
145145
<setting name="cacheEnabled" value="true"/>
146146
<setting name="lazyLoadingEnabled" value="true"/>
147147
<setting name="aggressiveLazyLoading" value="true"/>
148-
<setting name="multipleResultSetsEnabled" value="true"/>
149148
<setting name="useColumnLabel" value="true"/>
150149
<setting name="useGeneratedKeys" value="false"/>
151150
<setting name="autoMappingBehavior" value="PARTIAL"/>

src/site/zh_CN/xdoc/configuration.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
193193
</tr>
194194
<tr>
195195
<td>
196-
multipleResultSetsEnabled
196+
<strike>multipleResultSetsEnabled</strike>
197197
</td>
198198
<td>
199-
是否允许单个语句返回多结果集(需要数据库驱动支持)。
199+
Deprecated. This option has no effect.
200200
</td>
201201
<td>
202202
true | false
@@ -632,7 +632,6 @@ SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader, environ
632632
<setting name="cacheEnabled" value="true"/>
633633
<setting name="lazyLoadingEnabled" value="true"/>
634634
<setting name="aggressiveLazyLoading" value="true"/>
635-
<setting name="multipleResultSetsEnabled" value="true"/>
636635
<setting name="useColumnLabel" value="true"/>
637636
<setting name="useGeneratedKeys" value="false"/>
638637
<setting name="autoMappingBehavior" value="PARTIAL"/>

src/test/java/org/apache/ibatis/builder/XmlConfigBuilderTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-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.
@@ -86,7 +86,6 @@ void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
8686
assertThat(config.getProxyFactory()).isInstanceOf(JavassistProxyFactory.class);
8787
assertThat(config.isLazyLoadingEnabled()).isFalse();
8888
assertThat(config.isAggressiveLazyLoading()).isFalse();
89-
assertThat(config.isMultipleResultSetsEnabled()).isTrue();
9089
assertThat(config.isUseColumnLabel()).isTrue();
9190
assertThat(config.isUseGeneratedKeys()).isFalse();
9291
assertThat(config.getDefaultExecutorType()).isEqualTo(ExecutorType.SIMPLE);
@@ -193,7 +192,6 @@ void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
193192
assertThat(config.getProxyFactory()).isInstanceOf(CglibProxyFactory.class);
194193
assertThat(config.isLazyLoadingEnabled()).isTrue();
195194
assertThat(config.isAggressiveLazyLoading()).isTrue();
196-
assertThat(config.isMultipleResultSetsEnabled()).isFalse();
197195
assertThat(config.isUseColumnLabel()).isFalse();
198196
assertThat(config.isUseGeneratedKeys()).isTrue();
199197
assertThat(config.getDefaultExecutorType()).isEqualTo(ExecutorType.BATCH);

src/test/java/org/apache/ibatis/builder/xsd/XmlConfigBuilderTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-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.
@@ -75,7 +75,6 @@ void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
7575
assertTrue(config.getProxyFactory() instanceof JavassistProxyFactory);
7676
assertFalse(config.isLazyLoadingEnabled());
7777
assertFalse(config.isAggressiveLazyLoading());
78-
assertTrue(config.isMultipleResultSetsEnabled());
7978
assertTrue(config.isUseColumnLabel());
8079
assertFalse(config.isUseGeneratedKeys());
8180
assertEquals(ExecutorType.SIMPLE, config.getDefaultExecutorType());
@@ -114,7 +113,6 @@ void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
114113
assertTrue(config.getProxyFactory() instanceof CglibProxyFactory);
115114
assertTrue(config.isLazyLoadingEnabled());
116115
assertTrue(config.isAggressiveLazyLoading());
117-
assertFalse(config.isMultipleResultSetsEnabled());
118116
assertFalse(config.isUseColumnLabel());
119117
assertTrue(config.isUseGeneratedKeys());
120118
assertEquals(ExecutorType.BATCH, config.getDefaultExecutorType());

src/test/java/org/apache/ibatis/executor/BaseExecutorTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-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.
@@ -62,7 +62,6 @@ static void setup() throws Exception {
6262
config = new Configuration();
6363
config.setLazyLoadingEnabled(true);
6464
config.setUseGeneratedKeys(false);
65-
config.setMultipleResultSetsEnabled(true);
6665
config.setUseColumnLabel(true);
6766
config.setDefaultStatementTimeout(5000);
6867
config.setDefaultFetchSize(100);

src/test/resources/org/apache/ibatis/builder/CustomizedSettingsMapperConfig.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -34,7 +34,6 @@
3434
<setting name="proxyFactory" value="CGLIB"/>
3535
<setting name="lazyLoadingEnabled" value="true"/>
3636
<setting name="aggressiveLazyLoading" value="true"/>
37-
<setting name="multipleResultSetsEnabled" value="false"/>
3837
<setting name="useColumnLabel" value="false"/>
3938
<setting name="useGeneratedKeys" value="true"/>
4039
<setting name="defaultExecutorType" value="BATCH"/>

src/test/resources/org/apache/ibatis/builder/MapperConfig.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
2727
<settings>
2828
<setting name="cacheEnabled" value="true"/>
2929
<setting name="lazyLoadingEnabled" value="false"/>
30-
<setting name="multipleResultSetsEnabled" value="true"/>
3130
<setting name="useColumnLabel" value="true"/>
3231
<setting name="useGeneratedKeys" value="false"/>
3332
<setting name="defaultExecutorType" value="SIMPLE"/>

src/test/resources/org/apache/ibatis/builder/xsd/CustomizedSettingsMapperConfig.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
3232
<setting name="proxyFactory" value="CGLIB"/>
3333
<setting name="lazyLoadingEnabled" value="true"/>
3434
<setting name="aggressiveLazyLoading" value="true"/>
35-
<setting name="multipleResultSetsEnabled" value="false"/>
3635
<setting name="useColumnLabel" value="false"/>
3736
<setting name="useGeneratedKeys" value="true"/>
3837
<setting name="defaultExecutorType" value="BATCH"/>

src/test/resources/org/apache/ibatis/submitted/awful_table/MapperConfig.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
2424
<settings>
2525
<setting name="cacheEnabled" value="true"/>
2626
<setting name="lazyLoadingEnabled" value="false"/>
27-
<setting name="multipleResultSetsEnabled" value="true"/>
2827
<setting name="useColumnLabel" value="true"/>
2928
<setting name="defaultExecutorType" value="SIMPLE"/>
3029
<setting name="defaultStatementTimeout" value="25"/>

src/test/resources/org/apache/ibatis/submitted/blobtest/MapperConfig.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
2424
<settings>
2525
<setting name="cacheEnabled" value="true"/>
2626
<setting name="lazyLoadingEnabled" value="false"/>
27-
<setting name="multipleResultSetsEnabled" value="true"/>
2827
<setting name="useColumnLabel" value="true"/>
2928
<setting name="useGeneratedKeys" value="false"/>
3029
<setting name="defaultExecutorType" value="SIMPLE"/>

src/test/resources/org/apache/ibatis/submitted/multipleresultsetswithassociation/mybatis-config.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@
2525
<settings>
2626
<setting name="cacheEnabled" value="true"/>
2727
<setting name="lazyLoadingEnabled" value="true"/>
28-
<setting name="multipleResultSetsEnabled" value="true"/>
2928
<setting name="mapUnderscoreToCamelCase" value="true" />
3029
</settings>
3130

src/test/resources/org/apache/ibatis/submitted/nested_query_cache/MapperConfig.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2024 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -29,7 +29,6 @@
2929
<settings>
3030
<setting name="cacheEnabled" value="true"/>
3131
<setting name="lazyLoadingEnabled" value="false"/>
32-
<setting name="multipleResultSetsEnabled" value="true"/>
3332
<setting name="useColumnLabel" value="true"/>
3433
<setting name="useGeneratedKeys" value="false"/>
3534
<setting name="defaultExecutorType" value="SIMPLE"/>

0 commit comments

Comments
 (0)