首页 > 其他 > 详细

mybatis-generator 覆盖新增XML

时间:2019-03-14 15:42:46      阅读:483      评论:0      收藏:0      [点我收藏+]

参考文章:https://www.cnblogs.com/xxoome/p/10068780.html

1.添加依赖(版本1.3.7)

 

plugin>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-maven-plugin</artifactId>
    <version>1.3.7</version>
  <configuration>
    <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
    <overwrite>true</overwrite>
    <verbose>true</verbose>
  </configuration>
</plugin>

 

 

 

2.取消注释

 

<!-- 配置生成器 -->
<generatorConfiguration>

    <properties resource="mybatis/jdbc.properties"/>

    <context id="MyBatis" targetRuntime="MyBatis3"  defaultModelType="flat">

        <!-- 不生成注释 -->
        <commentGenerator>
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>
        
    ... ...

<generatorConfiguration>

 

 

 

3.添加插件

<!-- 配置生成器 -->
<generatorConfiguration>

    <properties resource="mybatis/jdbc.properties"/>

    <context id="MyBatis" targetRuntime="MyBatis3"  defaultModelType="flat">

        <!--覆盖生成XML文件-->
        <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
        
        <!-- 不生成注释 -->
        <commentGenerator>
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>

    ... ...

<generatorConfiguration>

 

mybatis-generator 覆盖新增XML

原文:https://www.cnblogs.com/baizhuang/p/10530539.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!