Skip to content

Commit f98f033

Browse files
authored
Merge pull request #517 from jeffgbutler/master
Remove implementationPackage attribute from javaClientConfiguration
2 parents 643798c + 9e17473 commit f98f033

File tree

6 files changed

+5
-56
lines changed

6 files changed

+5
-56
lines changed

core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/IntrospectedTable.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -647,25 +647,6 @@ public String getCountByExampleStatementId() {
647647
.get(InternalAttribute.ATTR_COUNT_BY_EXAMPLE_STATEMENT_ID);
648648
}
649649

650-
protected String calculateJavaClientImplementationPackage() {
651-
JavaClientGeneratorConfiguration config = context
652-
.getJavaClientGeneratorConfiguration();
653-
if (config == null) {
654-
return null;
655-
}
656-
657-
StringBuilder sb = new StringBuilder();
658-
if (stringHasValue(config.getImplementationPackage())) {
659-
sb.append(config.getImplementationPackage());
660-
} else {
661-
sb.append(config.getTargetPackage());
662-
}
663-
664-
sb.append(fullyQualifiedTable.getSubPackageForClientOrSqlMap(isSubPackagesEnabled(config)));
665-
666-
return sb.toString();
667-
}
668-
669650
private boolean isSubPackagesEnabled(PropertyHolder propertyHolder) {
670651
return isTrue(propertyHolder.getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES));
671652
}

core/mybatis-generator-core/src/main/java/org/mybatis/generator/config/JavaClientGeneratorConfiguration.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2006-2018 the original author or authors.
2+
* Copyright 2006-2019 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.
@@ -22,7 +22,6 @@
2222

2323
public class JavaClientGeneratorConfiguration extends TypedPropertyHolder {
2424
private String targetPackage;
25-
private String implementationPackage;
2625
private String targetProject;
2726

2827
public JavaClientGeneratorConfiguration() {
@@ -45,14 +44,6 @@ public void setTargetPackage(String targetPackage) {
4544
this.targetPackage = targetPackage;
4645
}
4746

48-
public String getImplementationPackage() {
49-
return implementationPackage;
50-
}
51-
52-
public void setImplementationPackage(String implementationPackage) {
53-
this.implementationPackage = implementationPackage;
54-
}
55-
5647
public void validate(List<String> errors, String contextId) {
5748
if (!stringHasValue(targetProject)) {
5849
errors.add(getString("ValidationError.2", contextId)); //$NON-NLS-1$

core/mybatis-generator-core/src/main/java/org/mybatis/generator/config/xml/MyBatisGeneratorConfigurationParser.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,14 +615,10 @@ private void parseJavaClientGenerator(Context context, Node node) {
615615
String type = attributes.getProperty("type"); //$NON-NLS-1$
616616
String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
617617
String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$
618-
String implementationPackage = attributes
619-
.getProperty("implementationPackage"); //$NON-NLS-1$
620618

621619
javaClientGeneratorConfiguration.setConfigurationType(type);
622620
javaClientGeneratorConfiguration.setTargetPackage(targetPackage);
623621
javaClientGeneratorConfiguration.setTargetProject(targetProject);
624-
javaClientGeneratorConfiguration
625-
.setImplementationPackage(implementationPackage);
626622

627623
NodeList nodeList = node.getChildNodes();
628624
for (int i = 0; i < nodeList.getLength(); i++) {

core/mybatis-generator-core/src/main/resources/org/mybatis/generator/config/xml/mybatis-generator-config_1_0.dtd

Lines changed: 2 additions & 3 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 2006-2018 the original author or authors.
4+
Copyright 2006-2019 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.
@@ -143,8 +143,7 @@
143143
<!ATTLIST javaClientGenerator
144144
type CDATA #REQUIRED
145145
targetPackage CDATA #REQUIRED
146-
targetProject CDATA #REQUIRED
147-
implementationPackage CDATA #IMPLIED>
146+
targetProject CDATA #REQUIRED>
148147

149148
<!--
150149
The table element is used to specify a database table that will be the source information

core/mybatis-generator-core/src/site/xhtml/configreference/javaClientGenerator.xhtml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,6 @@ specify this element, then MyBatis Generator (MBG) will not generate Java client
121121
</tr>
122122
</table>
123123

124-
<h2>Optional Attributes</h2>
125-
<table border="1" cellspacing="0" cellpadding="5">
126-
<tr>
127-
<th>Attribute</th>
128-
<th>Description</th>
129-
</tr>
130-
<tr>
131-
<td valign="top">implementationPackage</td>
132-
<td>If specified, implementation classes will be placed in this package.
133-
In the default generators, the property "enableSubPackages"
134-
controls how the actual package is calculated. If true,
135-
then the calculated package will be the implementationPackage plus
136-
sub packages for the table's catalog and schema if they exist.
137-
If "enableSubPackages" is false (the default) then the calculated package will be
138-
exactly what is specified in the implementationPackage attribute.
139-
MBG will create folders as required for the generated
140-
packages.</td>
141-
</tr>
142-
</table>
143-
144124
<h2>Child Elements</h2>
145125
<ul>
146126
<li><a href="property.html">&lt;property&gt;</a> (0..N)</li>

core/mybatis-generator-core/src/site/xhtml/whatsNew.xhtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ deprecated and will be removed in a future version</b> - so please switch to the
102102
are replaced by a new set of renderer classes. Note that the new renderer classes will produce
103103
code that is the same as the prior methods with very few exceptions - and those exceptions are related to
104104
bugs in the old methods.</li>
105+
<li>The attribute "implementationPackage" has been removed from the <code>&lt;javaClientGenerator&gt;</code>
106+
configuration. It was only used for iBatis.</li>
105107
</ul>
106108

107109
<h3>Other Changes</h3>

0 commit comments

Comments
 (0)