`
小小de她
  • 浏览: 1200 次
社区版块
存档分类
最新评论

generatorConfig.xml

阅读更多
<?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="C:\mysql-connector-java\5.1.34\mysql-connector-java-5.1.34.jar" />

<!--     <context id="DB2Tables" targetRuntime="Ibatis2Java5"> -->
      <context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
        <!--去除注释  -->
        <commentGenerator>
            <property name="suppressAllComments" value="true" />
        </commentGenerator>

        <!--数据库连接 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://xxxxx"
                        userId=""
                        password="">
        </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="com.xxxx.entity" targetProject="MAVEN">
            <property name="enableSubPackages" value="false" />
            <property name="trimStrings" value="true" />
        </javaModelGenerator>
        <!--生成SQLMAP文件 -->
        <sqlMapGenerator targetPackage="com.xxx.repository" targetProject="MAVEN">
            <property name="enableSubPackages" value="false" />
        </sqlMapGenerator>
        <!--生成Dao文件 可以配置 type="XMLMAPPER"生成xml的dao实现  context id="DB2Tables" 修改targetRuntime="MyBatis3"  -->
        <!--
        <javaClientGenerator type="SPRING" targetPackage="com..repository"  targetProject="MAVEN">
            <property name="enableSubPackages" value="false" />
        </javaClientGenerator>
-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.`.repository"
  targetProject="MAVEN"/>
        <!--对应数据库表 mysql可以加入主键自增 字段命名 忽略某字段等-->
        <table tableName="D012" domainObjectName="AuditLog"
      enableDeleteByExample="false"
        selectByExampleQueryId="false"
        enableSelectByExample="false"
        enableCountByExample="false"      
         >
<!--          enableUpdateByExample="false" -->
         <columnRenamingRule searchString="^C_|I_" replaceString="" />
<!-- <columnOverride column="C_TERMID" property="termId" jdbcType="CHAR" /> -->
    
     <!--         enableDeleteByExample="false" -->
<!--         enableUpdateByExample="false" -->
<!--         selectByExampleQueryId="false" -->
<!--         enableSelectByExample="false" -->
<!--         enableCountByExample="false" -->
        </table>

    </context>
</generatorConfiguration>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics