• 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

  • 相关阅读:
    spring-security原理
    win10忘记密码,重置密码
    ELK环境搭建
    Centos8.2安装docker
    pgsql重启
    什么是网站跳出率
    随记
    javascript中apply、call和bind的区别
    Android与Mysql服务器通信
    CentOS 7 最小化安装之后安装Mysql
  • 原文地址:https://www.cnblogs.com/wujf/p/10689210.html
Copyright © 2020-2023  润新知