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
6c832e49
Commit
6c832e49
authored
May 18, 2018
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V1.2.5
parent
2c41fd73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
README.md
README.md
+23
-0
No files found.
README.md
View file @
6c832e49
...
...
@@ -537,6 +537,7 @@ public class Test {
tb1
.
setField2
(
"xx1"
);
int
k3
=
this
.
tbMapper
.
upsertSelective
(
tb1
);
// --------------------------------- allowMultiQueries=true ------------------------------
// 4. 开启allowMultiQueries后增加upsertByExample,upsertByExampleSelective但强力建议不要使用(需保证团队没有使用statement提交sql,否则会存在sql注入风险)
Tb
tb2
=
new
Tb
.
Builder
()
.
field1
(
1
)
...
...
@@ -568,6 +569,28 @@ public class Test {
.
delFlag
(
Tb
.
DEL_FLAG_ON
)
.
build
();
int
k6
=
this
.
tbMapper
.
upsertWithBLOBs
(
tb
);
// --------------------------------- allowBatchUpsert=true ------------------------------
List
<
Tb
>
list
=
new
ArrayList
<>();
list
.
add
(
new
Tb
.
Builder
()
.
field1
(
0
)
.
field2
(
"xx0"
)
.
field3
(
0
)
.
field4
(
new
Date
())
.
build
()
);
list
.
add
(
new
Tb
.
Builder
()
.
field1
(
1
)
.
field2
(
"xx1"
)
.
field3
(
1
)
.
field4
(
new
Date
())
.
build
()
);
this
.
tbMapper
.
batchUpsert
(
list
);
// 对于BLOBs 有batchUpsertWithBLOBs方法
this
.
tbMapper
.
batchUpsertSelective
(
list
,
Tb
.
Column
.
field1
,
Tb
.
Column
.
field2
,
Tb
.
Column
.
field3
,
Tb
.
Column
.
createTime
);
this
.
tbMapper
.
batchUpsertSelective
(
list
,
Tb
.
Column
.
excludes
(
Tb
.
Column
.
id
,
Tb
.
Column
.
delFlag
));
// 排除某些列
}
}
```
...
...
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