Skip to content

Commit 915fdcf

Browse files
authored
Merge pull request #783 from harawata/782-deprecated-option
#782 multipleResultSetsEnabled has been deprecated in core 3.5.17
2 parents 88a55b5 + 569fdcc commit 915fdcf

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/main/java/org/mybatis/guice/MyBatisModule.java

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ protected final void aggressiveLazyLoading(boolean aggressiveLazyLoading) {
160160
/**
161161
* Multiple result sets enabled.
162162
*
163+
* @deprecated this option has no effect
164+
*
163165
* @param multipleResultSetsEnabled
164166
* the multiple result sets enabled
165167
*/

src/main/java/org/mybatis/guice/configuration/ConfigurationProvider.java

+4-4
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.
@@ -17,6 +17,8 @@
1717

1818
import com.google.inject.ProvisionException;
1919

20+
import edu.umd.cs.findbugs.annotations.Nullable;
21+
2022
import jakarta.inject.Named;
2123
import jakarta.inject.Provider;
2224
import jakarta.inject.Singleton;
@@ -35,8 +37,6 @@
3537
import org.mybatis.guice.configuration.settings.ConfigurationSetting;
3638
import org.mybatis.guice.configuration.settings.MapperConfigurationSetting;
3739

38-
import edu.umd.cs.findbugs.annotations.Nullable;
39-
4040
/**
4141
* Provides the myBatis Configuration.
4242
*/
@@ -56,6 +56,7 @@ public class ConfigurationProvider implements Provider<Configuration>, Configura
5656
@Named("mybatis.configuration.aggressiveLazyLoading")
5757
private boolean aggressiveLazyLoading = true;
5858

59+
@Deprecated
5960
@com.google.inject.Inject(optional = true)
6061
@Named("mybatis.configuration.multipleResultSetsEnabled")
6162
private boolean multipleResultSetsEnabled = true;
@@ -163,7 +164,6 @@ public Configuration get() {
163164
final Configuration configuration = newConfiguration(environment);
164165
configuration.setLazyLoadingEnabled(lazyLoadingEnabled);
165166
configuration.setAggressiveLazyLoading(aggressiveLazyLoading);
166-
configuration.setMultipleResultSetsEnabled(multipleResultSetsEnabled);
167167
configuration.setUseGeneratedKeys(useGeneratedKeys);
168168
configuration.setUseColumnLabel(useColumnLabel);
169169
configuration.setCacheEnabled(cacheEnabled);

src/main/java/org/mybatis/guice/configuration/settings/MultipleResultSetsEnabledConfigurationSetting.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 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.
@@ -17,6 +17,9 @@
1717

1818
import org.apache.ibatis.session.Configuration;
1919

20+
/**
21+
* @deprecated This option has no effect.
22+
*/
2023
public class MultipleResultSetsEnabledConfigurationSetting implements ConfigurationSetting {
2124

2225
private final boolean multipleResultSetsEnabled;

src/test/java/org/mybatis/guice/MyBatisModuleTest.java

+3-1
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.
@@ -63,6 +63,7 @@
6363
import org.apache.ibatis.type.TypeHandler;
6464
import org.junit.jupiter.api.Assertions;
6565
import org.junit.jupiter.api.BeforeEach;
66+
import org.junit.jupiter.api.Disabled;
6667
import org.junit.jupiter.api.Test;
6768
import org.junit.jupiter.api.extension.ExtendWith;
6869
import org.mockito.Mock;
@@ -272,6 +273,7 @@ protected void initialize() {
272273
assertEquals(true, configuration.isMultipleResultSetsEnabled());
273274
}
274275

276+
@Disabled("multipleResultSetsEnabled is deprecated")
275277
@Test
276278
void multipleResultSetsEnabled_False() {
277279
Injector injector = Guice.createInjector(new MyBatisModule() {

src/test/java/org/mybatis/guice/configuration/ConfigurationProviderTest.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 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.
@@ -104,7 +104,6 @@ protected void configure() {
104104
assertEquals(0, configuration.getInterceptors().size());
105105
assertFalse(configuration.isLazyLoadingEnabled());
106106
assertTrue(configuration.isAggressiveLazyLoading());
107-
assertTrue(configuration.isMultipleResultSetsEnabled());
108107
assertFalse(configuration.isUseGeneratedKeys());
109108
assertTrue(configuration.isUseColumnLabel());
110109
assertTrue(configuration.isCacheEnabled());
@@ -130,7 +129,6 @@ protected void configure() {
130129
bind(DataSource.class).toInstance(dataSource);
131130
bindConstant().annotatedWith(Names.named("mybatis.configuration.lazyLoadingEnabled")).to(true);
132131
bindConstant().annotatedWith(Names.named("mybatis.configuration.aggressiveLazyLoading")).to(false);
133-
bindConstant().annotatedWith(Names.named("mybatis.configuration.multipleResultSetsEnabled")).to(false);
134132
bindConstant().annotatedWith(Names.named("mybatis.configuration.useGeneratedKeys")).to(true);
135133
bindConstant().annotatedWith(Names.named("mybatis.configuration.useColumnLabel")).to(false);
136134
bindConstant().annotatedWith(Names.named("mybatis.configuration.cacheEnabled")).to(false);
@@ -183,7 +181,6 @@ public void applyConfigurationSetting(Configuration configuration) {
183181
assertEquals(databaseId, configuration.getDatabaseId());
184182
assertTrue(configuration.isLazyLoadingEnabled());
185183
assertFalse(configuration.isAggressiveLazyLoading());
186-
assertFalse(configuration.isMultipleResultSetsEnabled());
187184
assertTrue(configuration.isUseGeneratedKeys());
188185
assertFalse(configuration.isUseColumnLabel());
189186
assertFalse(configuration.isCacheEnabled());

0 commit comments

Comments
 (0)