<?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>
    <!--数据库驱动jar -->
    <classPathEntry
            location="D:\m2_yincheng\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />

    <context id="context" targetRuntime="MyBatis3">
        <!--去除注释 -->
        <commentGenerator>
            <property name="suppressAllComments" value="true" />
            <property name="suppressDate" value="true"/>
        </commentGenerator>

        <!--数据库连接 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/smart_community" userId="root"
                        password="DQ@0lW##kBb2+-jPZC1s$Ma0h5$9W((q">
        </jdbcConnection>
        <!--默认false Java type resolver will always use java.math.BigDecimal if
            the database column is of type DECIMAL or NUMERIC. -->
        <javaTypeResolver>
            <property name="forceBigDecimals" value="false" />
        </javaTypeResolver>

        <!--生成实体类 指定包名 以及生成的地址 （可以自定义地址，但是路径不存在不会自动创建 使用Maven生成在target目录下，会自动创建） -->
        <javaModelGenerator targetPackage="model"
                            targetProject="E:\gitcode\SpringProject\SmartCommunity\mybatisGeneratorCode\src\main\java\com\example\demo">
            <property name="enableSubPackages" value="true" />
            <property name="trimStrings" value="true" />
        </javaModelGenerator>
        <!--生成SQLMAP文件 -->
        <sqlMapGenerator targetPackage="mapper"
                         targetProject="E:\gitcode\SpringProject\SmartCommunity\mybatisGeneratorCode\src\main\resources">
            <property name="enableSubPackages" value="false" />
        </sqlMapGenerator>
        <!--生成Dao文件 可以配置 type="XMLMAPPER"生成xml的dao实现 context id="DB2Tables" 修改targetRuntime="MyBatis3" -->
        <javaClientGenerator type="XMLMAPPER"
                             targetPackage="dao"
                             targetProject="E:\gitcode\SpringProject\SmartCommunity\mybatisGeneratorCode\src\main\java\com\example\demo">
            <property name="enableSubPackages" value="false" />
        </javaClientGenerator>

        <!--对应数据库表 多个直接复制 -->
        <table tableName="mq_message" domainObjectName="MqMessage"
               enableCountByExample="false" enableUpdateByExample="false"
               enableDeleteByExample="false" enableSelectByExample="false"
               selectByExampleQueryId="false" />
    </context>
</generatorConfiguration>