• mybatis-generator 覆盖新增XML


    参考文章: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>
  • 相关阅读:
    古人诗词之王安石
    关于周期函数的命题
    Strum—Lioville问题
    计算反常积分
    【面积原理】计算级数和
    【洛谷P6046】纯粹容器
    【洛谷P3631】方格染色
    【牛客挑战赛48 E】速度即转发
    【CF103D】Time to Raid Cowavans
    【洛谷P4280】逆序对
  • 原文地址:https://www.cnblogs.com/baizhuang/p/10530539.html
Copyright © 2020-2023  润新知