• mybatis generator 整合lombok


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE generatorConfiguration
            PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
            "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
    
    <generatorConfiguration>
        <context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
            <property name="beginningDelimiter" value="`" />
            <property name="endingDelimiter" value="`" />
            <plugin type="tk.mybatis.mapper.generator.MapperPlugin">
                <property name="mappers" value="tk.mybatis.mapper.common.Mapper" />
            </plugin>
            <plugin type="com.chrm.mybatis.generator.plugins.LombokPlugin">
                <property name="hasLombok" value="true" />
            </plugin>
            
            <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                connectionURL=""
                userId="" password="">
            </jdbcConnection>
            <javaModelGenerator targetPackage="com.qmtt.model" targetProject="D:workspace" />
            <sqlMapGenerator targetPackage="com.qmtt.mapperXml" targetProject="D:workspace" />
            <javaClientGenerator targetPackage="com.qmtt.mapper" targetProject="D:workspace"
                type="XMLMAPPER" />
    
            <table tableName="voc_analyze_file_ret">
                <domainObjectRenamingRule searchString="^Voc" replaceString="" />
            </table>
        </context>
    </generatorConfiguration>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <optional>true</optional>
            </dependency>
    <!-- 通用mapper生成插件 -->
                <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>1.3.6</version>
                    <configuration>
                        <configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
                        <overwrite>true</overwrite>
                        <verbose>true</verbose>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>mysql</groupId>
                            <artifactId>mysql-connector-java</artifactId>
                            <version>5.1.44</version>
                        </dependency>
                        <dependency>
                            <groupId>tk.mybatis</groupId>
                            <artifactId>mapper</artifactId>
                            <version>3.4.6</version>
                        </dependency>
                        <dependency>
                            <groupId>com.chrm</groupId>
                            <artifactId>mybatis-generator-lombok-plugin</artifactId>
                            <version>1.0-SNAPSHOT</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>


    mybatis-generator-lombok-plugin下载地址 https://github.com/GuoGuiRong/mybatis-generator-lombok-plugin,下载完执行mvn install

    有追求,才有动力!

    向每一个软件工程师致敬!

    by wujf

    mail:921252375@qq.com

  • 相关阅读:
    HWOJ之纠结的优化
    java中的对象数组
    短路特性的运用
    归并排序
    两个有序数列的合并
    java中的注释规范
    堆排序
    堆的建立
    希尔排序
    直接插入排序
  • 原文地址:https://www.cnblogs.com/wujf/p/10689210.html
Copyright © 2020-2023  润新知