• generator插件配置方式使用


    generator插件配置方式使用

        <build>
            <plugins>
                <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>1.3.2</version>
                    <configuration>
                        <configurationFile>${project.basedir}/src/main/resources/mybatis/generatorConfig.xml
                        </configurationFile>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    

    generatorConfig.xml:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE generatorConfiguration
            PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
            "mybatis-generator-config_1_0.dtd">
    
    <generatorConfiguration>
    
        <classPathEntry location="G:actionflymybatissrcmain
    esourcesmybatismysql-connector-java-5.1.8.jar"/>
    
        <context id="MysqlTables" targetRuntime="MyBatis3">
            <!--去除注释  -->
            <commentGenerator>
                <property name="suppressAllComments" value="true"/>
            </commentGenerator>
    
            <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                            connectionURL="jdbc:mysql://localhost:3306/mybatis"
                            userId="root"
                            password="root">
            </jdbcConnection>
    
            <javaTypeResolver>
                <property name="forceBigDecimals" value="false"/>
            </javaTypeResolver>
    
            <javaModelGenerator targetPackage="mapper" targetProject="G:actionflymybatissrcmainjava">
                <property name="enableSubPackages" value="true"/>
                <property name="trimStrings" value="true"/>
            </javaModelGenerator>
    
            <sqlMapGenerator targetPackage="xml" targetProject="G:actionflymybatissrcmain
    esources">
                <property name="enableSubPackages" value="true"/>
            </sqlMapGenerator>
    
            <javaClientGenerator type="XMLMAPPER" targetPackage="mapper" targetProject="G:actionflymybatissrcmainjava">
                <property name="enableSubPackages" value="true"/>
            </javaClientGenerator>
    
            <table schema="mybatis" tableName="user" domainObjectName="User">
                <property name="useActualColumnNames" value="false"/>
                <!--<generatedKey column="ID" sqlStatement="DB2" identity="true"/>-->
                <columnOverride column="DATE_FIELD" property="startDate"/>
                <ignoreColumn column="FRED"/>
                <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR"/>
            </table>
    
    
        </context>
    </generatorConfiguration>
    

    还需要:
    mybatis-generator-config_1_0.dtd
    mysql-connector-java-5.1.8.jar

  • 相关阅读:
    【东师软工】第二次成绩排行榜
    博客(懒得在cnblog移了)
    elementUI el-tree 修改无子项的样式
    流文件下载方法
    2.2.3 核心模块--理解.NetCore Configuration 配置管理
    Centos7下安装部署Asp.Net Core多版本依赖环境
    LADP认证接入
    Identity Server基础
    浅析DevOps中结合IAST的落地介绍
    从Leetcode的回文子串中学习动态规划和中心扩散法
  • 原文地址:https://www.cnblogs.com/fly-book/p/10399198.html
Copyright © 2020-2023  润新知