mybatis-generator生成數據表中註釋

  1. 克隆項目,打jar包
    git clone https://github.com/backkoms/mybatis-generator-comments.git

    編譯打包,install到本地或delopy私服庫中都可。java

  2. 修改pom文件
    <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>${plugins-mybatis-generator.version}</version>
                    <configuration>
                        <verbose>true</verbose>
                        <overwrite>true</overwrite>
                    </configuration>
    
                    <dependencies>
                        <dependency>
                            <groupId>com.haier.hairy</groupId>
                            <artifactId>mybatis-generator-core</artifactId>
                            <version>1.0.1</version>
                        </dependency>
                    </dependencies>
              </plugin>

     

  3. 配置對應的解析生成包  
    <commentGenerator type="org.mybatis.generator.internal.CustomeCommentGenerator">
         <property name="javaFileEncoding" value="UTF-8"/>
         <property name="suppressDate" value="true" />
         <property name="suppressAllComments" value="false" />
    </commentGenerator>

    執行命令:mvn mybatis-generator:generate
    查看執行生成文件
    git

相關文章
相關標籤/搜索