Skip to content

Latest commit

 

History

History
43 lines (40 loc) · 1.34 KB

File metadata and controls

43 lines (40 loc) · 1.34 KB

mygenerator-plugin

MyBatis Generator Plugin. 自动生成类和字段的注释,同时生成批量插入的sql

how to run with maven

  1. mvn install
  2. in your pom.xml, add dependency of the plugin.
<build>
    <plugins>
        <plugin>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-maven-plugin</artifactId>
            <version>1.3.5</version>
            <dependencies>
                <dependency>
                    <groupId>com.hollyshi</groupId>
                    <artifactId>mygenerator-plugin</artifactId>
                    <version>1.0.0-SNAPSHOT</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
  1. in your generatorConfig.xml, add the plugin.
<plugin type="com.hollyshi.mybatis.generator.MyGeneratorPlugin">
    <property name="modelClassAuthor" value="hollyshi"/>
</plugin>

<commentGenerator>
    <!-- we do not want those comments generated by the plugin itself -->
    <property name="suppressAllComments" value="true"/>
    <property name="suppressDate" value="true"/>
</commentGenerator>

<jdbcConnection driverClass="...">
    <!-- use information schema so we can get the table remarks -->
    <property name="useInformationSchema" value="true"/>
</jdbcConnection>
  1. run mvn mybatis-generator:generate
  2. done.