Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mybatis-generator-plugin
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mybatis-generator-plugin
Commits
df7be169
Commit
df7be169
authored
Jun 13, 2017
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: Selective增强插件,对于主键为字符串是没有if节点的,不需要进行isSelective()操作
parent
4d02bb9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
27 deletions
+32
-27
src/main/java/com/itfsw/mybatis/generator/plugins/SelectiveEnhancedPlugin.java
...sw/mybatis/generator/plugins/SelectiveEnhancedPlugin.java
+32
-27
No files found.
src/main/java/com/itfsw/mybatis/generator/plugins/SelectiveEnhancedPlugin.java
View file @
df7be169
...
...
@@ -232,6 +232,8 @@ public class SelectiveEnhancedPlugin extends BasePlugin {
XmlElement
whenEle
=
new
XmlElement
(
"when"
);
whenEle
.
addAttribute
(
new
Attribute
(
"test"
,
prefix
+
"isSelective()"
));
for
(
Element
ele
:
element
.
getElements
())
{
// 对于字符串主键,是没有if判断节点的
if
(
ele
instanceof
XmlElement
){
// if的text节点
XmlElement
xmlElement
=
(
XmlElement
)
ele
;
TextElement
textElement
=
(
TextElement
)
xmlElement
.
getElements
().
get
(
0
);
...
...
@@ -263,6 +265,9 @@ public class SelectiveEnhancedPlugin extends BasePlugin {
ifEle
.
addAttribute
(
new
Attribute
(
"test"
,
prefix
+
"isSelective(\'"
+
field
+
"\')"
));
ifEle
.
addElement
(
textElement
);
whenEle
.
addElement
(
ifEle
);
}
else
{
whenEle
.
addElement
(
ele
);
}
}
// otherwise
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment