Mybatis Generator Plugin Versions Save

Mybatis Generator 代码生成插件拓展,增加:查询单条数据插件(SelectOneByExamplePlugin)、MySQL分页插件(LimitPlugin)、数据Model链式构建插件(ModelBuilderPlugin)、Example Criteria 增强插件(ExampleEnhancedPlugin)、Example 目标包修改插件(ExampleTargetPlugin)、批量插入插件(BatchInsertPlugin)、逻辑删除插件(LogicalDeletePlugin)、数据Model属性对应Column获取插件(ModelColumnPlugin)、存在即更新(UpsertPlugin)、Selective选择插入更新增强插件(SelectiveEnhancedPlugin)、Table增加前缀插件(TableSuffixPlugin)、自定义注释插件(CommentPlugin)、增量插件(IncrementsPlugin)、查询结果选择性返回插件(SelectSelectivePlugin)、乐观锁插件(OptimisticLockerPlugin)、LombokPlugin等拓展。

V1.4.6

1 month ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenameConfigurationPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.4.6</version>
</dependency>

UPDATE:

  • [fix]升级mybatis-generator-core到1.4.2版本,官方initialized调用逻辑变更导致部分插件异常;

V1.4.5

2 months ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenameConfigurationPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.4.5</version>
</dependency>

UPDATE:

  • [feat]升级mybatis-generator-core到1.4.2版本,去除一些官方已经自带的插件并去掉一些过时插件;

V1.3.10

3 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.10</version>
</dependency>

UPDATE:

  • [bug]状态枚举生成插件(EnumTypeStatusPlugin) parseValue parseName应该为静态方法;

V1.3.9

3 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.9</version>
</dependency>

UPDATE:

  • pull#120:Mapper注解插件(MapperAnnotationPlugin)增加更灵活的注解生成方式;
  • 状态枚举生成插件(EnumTypeStatusPlugin) 增加parseValue parseName方法;
  • IncrementPlugin 整合 SelectiveEnhancedPlugin foreach xml 节点漏判断自增条件BUG;
  • Example Criteria 增强插件(ExampleEnhancedPlugin)增强distinct方法,方便链式调用;

V1.3.8

4 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.8</version>
</dependency>

UPDATE:

  • issues#100:状态枚举生成插件(EnumTypeStatusPlugin)正则表达式错误导致某些情况无法正常生成枚举的BUG;

V1.3.7

4 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.7</version>
</dependency>

UPDATE:

  • 重构IncrementPlugin,之前版本借助ModelColumn做inc和dec操作,不能够直观的知道当前表支持Increment操作的字段有哪些,新增了Increment枚举方便直接操作;
  • 修复LimitPlugin之前对于xxByExample方法对于传入null Example没有进行空判断的bug;

上一版本

  • 优化IncrementPlugin的increment方法,返回对象本身使之可使用链式语法;
  • 优化ModelColumnPlugin增加all方法返回所有字段;
  • 修复SelectSelectivePlugin之前对于xxByExample方法对于传入null Example没有进行空判断的bug;

V1.3.6.4

4 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.6</version>
</dependency>

UPDATE:

  • 优化IncrementPlugin的increment方法,返回对象本身使之可使用链式语法;
  • 优化ModelColumnPlugin增加all方法返回所有字段;
  • 修复SelectSelectivePlugin之前对于xxByExample方法对于传入null Example没有进行空判断的bug;

上一版本

  • 优化LombokPlugin插件,增加可选配置supportSuperBuilderForIdea解决目前IDEA Lombok插件不支持SuperBuilder的问题;

V1.3.5

4 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.5</version>
</dependency>

UPDATE:

  • 优化LombokPlugin插件,增加可选配置supportSuperBuilderForIdea解决目前IDEA Lombok插件不支持SuperBuilder的问题;

上一版本

  • 优化LombokPlugin插件,配置了@Builder的时候只在必须情况下替换成@SuperBuilder;

V1.3.4

4 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.4</version>
</dependency>

UPDATE:

  • 优化LombokPlugin插件,配置了@Builder的时候只在必须情况下替换成@SuperBuilder;

上一版本

  • issues#78:新增IncrementPlugin插件替代IncrementsPlugin插件,老版本插件整合LombokPlugin插件时会过多侵入生成的Builder代码;
  • issues#87:重构LombokPlugin插件,使之支持更多注解;
  • 修正SelectiveEnhancedPlugin插件对typeHandler支持问题;
  • 修正OptimisticLockerPlugin自定义nextVersion使用方式,不再推荐使用builder的nextVersion方法,而使用实体类中的nextVersion代替;
  • 新增Mapper注解插件,增强官方的MapperAnnotationPlugin插件,可自定义添加@Repository注解解决IDEA工具使用@Autowired会报无法找到对应bean的错误;

V1.3.3

4 years ago
<!-- 查询单条数据插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
<!-- 数据Model链式构建插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
<!-- Example Criteria 增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
<!-- MySQL分页插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin"/>
<!-- Example 目标包修改插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"/>
<!-- 批量插入插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin"/>
<!-- 逻辑删除插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin"/>
<!-- 数据Model属性对应Column获取插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
<!-- 存在即更新插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin"/>
<!-- Selective选择插入更新增强插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
<!-- Table增加前缀插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TablePrefixPlugin"/>
<!-- Table重命名插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableRenamePlugin"/>
<!-- 自定义注释插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.CommentPlugin"/>
<!-- 增量插件(过时) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementsPlugin"/>
<!-- 查询结果选择性返回插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
<!-- 乐观锁插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.OptimisticLockerPlugin"/>
<!-- 表重命名配置插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.TableConfigurationPlugin"/>
<!-- Lombok插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin"/>
<!-- 数据ModelCloneable插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.ModelCloneablePlugin"/>
<!-- 状态枚举生成插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin"/>
<!-- 增量插件(新) -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
<!-- Mapper注解插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin"/>

Maven依赖:

<dependency>
    <groupId>com.itfsw</groupId>
    <artifactId>mybatis-generator-plugin</artifactId>
    <version>1.3.3</version>
</dependency>

UPDATE:

  • issues#78:新增IncrementPlugin插件替代IncrementsPlugin插件,老版本插件整合LombokPlugin插件时会过多侵入生成的Builder代码;
  • issues#87:重构LombokPlugin插件,使之支持更多注解;
  • 修正SelectiveEnhancedPlugin插件对typeHandler支持问题;
  • 修正OptimisticLockerPlugin自定义nextVersion使用方式,不再推荐使用builder的nextVersion方法,而使用实体类中的nextVersion代替;
  • 新增Mapper注解插件,增强官方的MapperAnnotationPlugin插件,可自定义添加@Repository注解解决IDEA工具使用@Autowired会报无法找到对应bean的错误;

上一版本

  • issues#81:解决CommentPlugin在配置全局suppressAllComments情况下还生成注释的bug,同时替换默认插件注释生成工具为DefaultCommentGenerator;