MyBatis Generator Plugin. 自动生成类和字段的注释,同时生成批量插入的sql
- mvn install
- 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>- 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>- run
mvn mybatis-generator:generate - done.