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
2d989783
Commit
2d989783
authored
May 04, 2018
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
乐观锁插件整合Selective增强插件
parent
378bcd4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/main/java/com/itfsw/mybatis/generator/plugins/OptimisticLockerPlugin.java
...fsw/mybatis/generator/plugins/OptimisticLockerPlugin.java
+4
-4
No files found.
src/main/java/com/itfsw/mybatis/generator/plugins/OptimisticLockerPlugin.java
View file @
2d989783
...
@@ -129,7 +129,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
...
@@ -129,7 +129,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
@Override
@Override
public
boolean
clientUpdateByPrimaryKeySelectiveMethodGenerated
(
Method
method
,
Interface
interfaze
,
IntrospectedTable
introspectedTable
)
{
public
boolean
clientUpdateByPrimaryKeySelectiveMethodGenerated
(
Method
method
,
Interface
interfaze
,
IntrospectedTable
introspectedTable
)
{
if
(
this
.
versionColumn
!=
null
)
{
if
(
this
.
versionColumn
!=
null
)
{
Method
withVersion
=
this
.
replaceUpdate
Example
Method
(
introspectedTable
,
method
,
interfaze
,
METHOD_UPDATE_WITH_VERSION_BY_PRIMARY_KEY_SELECTIVE
);
Method
withVersion
=
this
.
replaceUpdate
PrimaryKey
Method
(
introspectedTable
,
method
,
interfaze
,
METHOD_UPDATE_WITH_VERSION_BY_PRIMARY_KEY_SELECTIVE
);
if
(
PluginTools
.
getHook
(
IOptimisticLockerPluginHook
.
class
).
clientUpdateWithVersionByPrimaryKeySelectiveMethodGenerated
(
withVersion
,
interfaze
,
introspectedTable
))
{
if
(
PluginTools
.
getHook
(
IOptimisticLockerPluginHook
.
class
).
clientUpdateWithVersionByPrimaryKeySelectiveMethodGenerated
(
withVersion
,
interfaze
,
introspectedTable
))
{
FormatTools
.
addMethodWithBestPosition
(
interfaze
,
withVersion
);
FormatTools
.
addMethodWithBestPosition
(
interfaze
,
withVersion
);
}
}
...
@@ -142,7 +142,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
...
@@ -142,7 +142,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
if
(
this
.
versionColumn
!=
null
)
{
if
(
this
.
versionColumn
!=
null
)
{
FormatTools
.
addMethodWithBestPosition
(
FormatTools
.
addMethodWithBestPosition
(
interfaze
,
interfaze
,
this
.
replaceUpdatePrimaryKey
Xml
Method
(
introspectedTable
,
method
,
interfaze
,
METHOD_UPDATE_WITH_VERSION_BY_PRIMARY_KEY_WITH_BLOBS
)
this
.
replaceUpdatePrimaryKeyMethod
(
introspectedTable
,
method
,
interfaze
,
METHOD_UPDATE_WITH_VERSION_BY_PRIMARY_KEY_WITH_BLOBS
)
);
);
}
}
return
super
.
clientUpdateByPrimaryKeyWithBLOBsMethodGenerated
(
method
,
interfaze
,
introspectedTable
);
return
super
.
clientUpdateByPrimaryKeyWithBLOBsMethodGenerated
(
method
,
interfaze
,
introspectedTable
);
...
@@ -153,7 +153,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
...
@@ -153,7 +153,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
if
(
this
.
versionColumn
!=
null
)
{
if
(
this
.
versionColumn
!=
null
)
{
FormatTools
.
addMethodWithBestPosition
(
FormatTools
.
addMethodWithBestPosition
(
interfaze
,
interfaze
,
this
.
replaceUpdatePrimaryKey
Xml
Method
(
introspectedTable
,
method
,
interfaze
,
METHOD_UPDATE_WITH_VERSION_BY_PRIMARY_KEY_WITHOUT_BLOBS
)
this
.
replaceUpdatePrimaryKeyMethod
(
introspectedTable
,
method
,
interfaze
,
METHOD_UPDATE_WITH_VERSION_BY_PRIMARY_KEY_WITHOUT_BLOBS
)
);
);
}
}
return
super
.
clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated
(
method
,
interfaze
,
introspectedTable
);
return
super
.
clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated
(
method
,
interfaze
,
introspectedTable
);
...
@@ -404,7 +404,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
...
@@ -404,7 +404,7 @@ public class OptimisticLockerPlugin extends BasePlugin {
* @param methodName
* @param methodName
* @return
* @return
*/
*/
private
Method
replaceUpdatePrimaryKey
Xml
Method
(
IntrospectedTable
introspectedTable
,
Method
method
,
Interface
interfaze
,
String
methodName
)
{
private
Method
replaceUpdatePrimaryKeyMethod
(
IntrospectedTable
introspectedTable
,
Method
method
,
Interface
interfaze
,
String
methodName
)
{
Method
withVersionMethod
=
new
Method
(
method
);
Method
withVersionMethod
=
new
Method
(
method
);
// 替换方法名
// 替换方法名
...
...
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