Giter Club home page Giter Club logo

mybatis-generator-plugins's Introduction

myBatisGeneratorPlugins

一些mybatis-generator扩展插件集合

已实现功能

  • 自动添加swagger2注解到实体类
  • 扩展set方法,返回this实例;方便链式调用

maven引用

<!-- https://mvnrepository.com/artifact/com.github.misterchangray.mybatis.generator.plugins/myBatisGeneratorPlugins -->
<dependency>
    <groupId>com.github.misterchangray.mybatis.generator.plugins</groupId>
    <artifactId>myBatisGeneratorPlugins</artifactId>
    <version>1.2</version>
</dependency>

详细介绍

1. 自动添加swagger2注解到实体类

自动为entity类生成swagger2文档注解,注解内容为数据库comment内容

        <!-- 自动为entity生成swagger2文档-->
        <plugin type="mybatis.generator.plugins.GeneratorSwagger2Doc">
          <property name="apiModelAnnotationPackage" value="io.swagger.annotations.ApiModel" />
          <property name="apiModelPropertyAnnotationPackage" value="io.swagger.annotations.ApiModelProperty" />
        </plugin>

2.扩展entity的set方法

扩展entity的set方法;返回当前this实例,方便链式调用

        <!-- 扩展entity的set方法-->
        <plugin type="mybatis.generator.plugins.ExtendEntitySetter" />

怎么引入到项目中

增加依赖到你的pom.xml文件 mybatis 节点下,如下:
add dependency to your pom.xml on mybatis node. like:

<!-- maven  -->
<build>
    <finalName>common-core</finalName>
    <!--  ...  -->
    <plugins>
      <!--mybatis 逆向工程插件-->
      <plugin>
        <groupId>org.mybatis.generator</groupId>
        <artifactId>mybatis-generator-maven-plugin</artifactId>
        <version>1.3.5</version>
        <configuration>
          <verbose>true</verbose>
          <overwrite>true</overwrite>
        </configuration>
        <dependencies>
          <!--  use plugin  -->
          <!-- https://mvnrepository.com/artifact/com.github.misterchangray.mybatis.generator.plugins/myBatisGeneratorPlugins -->
          <dependency>
              <groupId>com.github.misterchangray.mybatis.generator.plugins</groupId>
              <artifactId>myBatisGeneratorPlugins</artifactId>
              <version>1.2</version>
          </dependency>
  
        </dependencies>
      </plugin>
    </plugins>
  </build>

runtime environment

  • OS Microsoft Windows 10 Pro
  • Java 8
  • springMVC 4.3
  • Mybitis 3.4
  • Mysql 5.5.50
  • Restful interface
  • Maven 3.5.3
  • Git 2.14.1
  • Swagger 2.6.1

mybatis-generator-plugins's People

Contributors

misterchangray avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.