Skip to content

Commit

Permalink
feat: add batch insert plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
spawpaw committed Apr 15, 2018
1 parent 3e91c89 commit ef6da63
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/spawpaw/mybatis/generator/gui/ProjectConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ public class ProjectConfig {
@Config(bundle = "project.enableCaseInsensitiveLikePlugin", type = ConfigType.CheckBox)
public SimpleBooleanProperty enableCaseInsensitiveLikePlugin = new SimpleBooleanProperty(true);

@ExportToTab(tabName = DATA_ACCESS_OBJECT, index = 1)
@EnablePlugin(DeclaredPlugins.ModelColumnPlugin)
@Config(bundle = "project.enableModelColumnPlugin", type = ConfigType.CheckBox)
public SimpleBooleanProperty enableModelColumnPlugin = new SimpleBooleanProperty(false);

@ExportToTab(tabName = DATA_ACCESS_OBJECT, index = 1)
@EnablePlugin(DeclaredPlugins.BatchInsertPlugin)
@Config(bundle = "project.enableBatchInsertPlugin", type = ConfigType.CheckBox)
public SimpleBooleanProperty enableBatchInsertPlugin = new SimpleBooleanProperty(false);

@AdvancedConfig
@ExportToTab(tabName = DATA_ACCESS_OBJECT, index = 1)
@ExportToTab(tabName = SHORTCUT, index = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class DeclaredPlugins {

//github开源项目https://github.com/itfsw/mybatis-generator-plugin中的插件
public static final String LogicalDeletePlugin = "com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin";
public static final String BatchInsertPlugin = "com.itfsw.mybatis.generator.plugins.BatchInsertPlugin";
public static final String ModelColumnPlugin = "com.itfsw.mybatis.generator.plugins.ModelColumnPlugin";

public static final String CommentPlugin = "com.spawpaw.mybatis.generator.gui.plugin.CommentPlugin";
public static final String PagePlugin = "com.spawpaw.mybatis.generator.gui.plugin.PagePlugin";
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/i18n/locale.properties
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,12 @@ plugin.logicalDeletePlugin.logicalDeleteConstName.helpText=LogicalDeleteConstNam
plugin.logicalDeletePlugin.logicalUnDeleteConstName.labelText=LogicalUnDeleteConstName
plugin.logicalDeletePlugin.logicalUnDeleteConstName.helpText=LogicalUnDeleteConstName
##

project.enableModelColumnPlugin.labelText=enableModelColumnPlugin
project.enableModelColumnPlugin.helpText=get actual column name.
##

project.enableBatchInsertPlugin.labelText=enableBatchInsertPlugin
project.enableBatchInsertPlugin.helpText=provide `batchInsert` and `batchInsertSelective`\n\
only supports SqlServer and MySql
##
9 changes: 9 additions & 0 deletions src/main/resources/i18n/locale_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,12 @@ plugin.logicalDeletePlugin.logicalDeleteConstName.helpText=LogicalDeleteConstNam
plugin.logicalDeletePlugin.logicalUnDeleteConstName.labelText=LogicalUnDeleteConstName
plugin.logicalDeletePlugin.logicalUnDeleteConstName.helpText=LogicalUnDeleteConstName
##

project.enableModelColumnPlugin.labelText=enableModelColumnPlugin
project.enableModelColumnPlugin.helpText=get actual column name.
##

project.enableBatchInsertPlugin.labelText=enableBatchInsertPlugin
project.enableBatchInsertPlugin.helpText=provide `batchInsert` and `batchInsertSelective`\n\
only supports SqlServer and MySql
##
10 changes: 10 additions & 0 deletions src/main/resources/i18n/locale_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,13 @@ plugin.logicalDeletePlugin.logicalDeleteConstName.helpText=\u4EE3\u8868\u5DF2\u5
plugin.logicalDeletePlugin.logicalUnDeleteConstName.labelText=\u903B\u8F91\u5220\u9664\u5E38\u91CF\uFF08\u672A\u5220\u9664\uFF09
plugin.logicalDeletePlugin.logicalUnDeleteConstName.helpText=\u4EE3\u8868\u672A\u5220\u9664\u7684\u5E38\u91CF
##

project.enableModelColumnPlugin.labelText=\u542F\u7528\u771F\u5B9E\u5B57\u6BB5\u83B7\u53D6\u63D2\u4EF6
project.enableModelColumnPlugin.helpText=\u83B7\u53D6\u6570\u636EModel\u5BF9\u5E94\u6570\u636E\u5E93\u5B57\u6BB5\u7684\u540D\u79F0
##

project.enableBatchInsertPlugin.labelText=\u542F\u7528\u6279\u91CF\u63D2\u5165\u63D2\u4EF6
project.enableBatchInsertPlugin.helpText=\u63D0\u4F9B\u4E86\u6279\u91CF\u63D2\u5165batchInsert\u548CbatchInsertSelective\u65B9\u6CD5\uFF0C\n\
\u56E0\u4E3A\u65B9\u6CD5\u4F7F\u7528\u4E86\u4F7F\u7528\u4E86JDBC\u7684getGenereatedKeys\u65B9\u6CD5\u8FD4\u56DE\u63D2\u5165\u4E3B\u952E\uFF0C\u6240\u4EE5\u53EA\u80FD\u5728MYSQL\u548CSQLServer\u4E0B\u4F7F\u7528\u3002\n\
\u9700\u914D\u5408\u6570\u636EModel\u5C5E\u6027\u5BF9\u5E94Column\u83B7\u53D6\u63D2\u4EF6\uFF08ModelColumnPlugin\uFF09\u63D2\u4EF6\u4F7F\u7528\uFF0C\u5B9E\u73B0\u7C7B\u4F3C\u4E8EinsertSelective\u63D2\u5165\u5217
##

0 comments on commit ef6da63

Please sign in to comment.