Skip to content

Commit a01b27e

Browse files
committed
mybatis#101: Remove experimental flag
- We are sure that this path is not invoked by current versions of mybatis, and if it was, iut would have failed, it is thus safe to remove the flag
1 parent 558c8a1 commit a01b27e

File tree

10 files changed

+33
-131
lines changed

10 files changed

+33
-131
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,6 @@ private void settingsElement(Properties props) {
292292
booleanValueOf(props.getProperty("argNameBasedConstructorAutoMapping"), false));
293293
configuration.setDefaultSqlProviderType(resolveClass(props.getProperty("defaultSqlProviderType")));
294294
configuration.setNullableOnForEach(booleanValueOf(props.getProperty("nullableOnForEach"), false));
295-
configuration.setExperimentalConstructorCollectionMapping(
296-
booleanValueOf(props.getProperty("experimentalConstructorCollectionMapping"), false));
297295
}
298296

299297
private void environmentsElement(XNode context) throws Exception {

src/main/java/org/apache/ibatis/mapping/ResultMap.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,10 @@ public ResultMap build() {
114114
resultMap.constructorResultMappings.add(resultMapping);
115115

116116
// #101
117-
if (resultMap.configuration.isExperimentalConstructorCollectionMappingEnabled()) {
118-
Class<?> javaType = resultMapping.getJavaType();
119-
resultMap.hasResultMapsUsingConstructorCollection = resultMap.hasResultMapsUsingConstructorCollection
120-
|| (resultMapping.getNestedQueryId() == null && javaType != null
121-
&& resultMap.configuration.getObjectFactory().isCollection(javaType));
122-
}
117+
Class<?> javaType = resultMapping.getJavaType();
118+
resultMap.hasResultMapsUsingConstructorCollection = resultMap.hasResultMapsUsingConstructorCollection
119+
|| (resultMapping.getNestedQueryId() == null && javaType != null
120+
&& resultMap.configuration.getObjectFactory().isCollection(javaType));
123121

124122
if (resultMapping.getProperty() != null) {
125123
constructorArgNames.add(resultMapping.getProperty());

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public class Configuration {
117117
protected boolean shrinkWhitespacesInSql;
118118
protected boolean nullableOnForEach;
119119
protected boolean argNameBasedConstructorAutoMapping;
120-
protected boolean experimentalConstructorCollectionMapping;
121120

122121
protected String logPrefix;
123122
protected Class<? extends Log> logImpl;
@@ -370,14 +369,6 @@ public boolean isSafeRowBoundsEnabled() {
370369
return safeRowBoundsEnabled;
371370
}
372371

373-
public void setExperimentalConstructorCollectionMapping(boolean experimentalConstructorCollectionMapping) {
374-
this.experimentalConstructorCollectionMapping = experimentalConstructorCollectionMapping;
375-
}
376-
377-
public boolean isExperimentalConstructorCollectionMappingEnabled() {
378-
return experimentalConstructorCollectionMapping;
379-
}
380-
381372
public void setSafeRowBoundsEnabled(boolean safeRowBoundsEnabled) {
382373
this.safeRowBoundsEnabled = safeRowBoundsEnabled;
383374
}

src/site/markdown/configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ These are extremely important tweaks that modify the way that MyBatis behaves at
137137
| defaultSqlProviderType | Specifies an sql provider class that holds provider method (Since 3.5.6). This class apply to the `type`(or `value`) attribute on sql provider annotation(e.g. `@SelectProvider`), when these attribute was omitted. | A type alias or fully qualified class name | Not set |
138138
| nullableOnForEach | Specifies the default value of 'nullable' attribute on 'foreach' tag. (Since 3.5.9) | true &#124; false | false |
139139
| argNameBasedConstructorAutoMapping | When applying constructor auto-mapping, argument name is used to search the column to map instead of relying on the column order. (Since 3.5.10) | true &#124; false | false |
140-
| experimentalConstructorCollectionMapping | When applying constructor mapping and any nested result mappings containing collections are found, they will now be filled (Since 3.6.0) | true &#124; false | false |
141140

142141
An example of the settings element fully configured is as follows:
143142

0 commit comments

Comments
 (0)