美文网首页
使用Mybatis-Generator自动生成Dao、Model

使用Mybatis-Generator自动生成Dao、Model

作者: 梦龙雪糕 | 来源:发表于2020-08-11 16:07 被阅读0次

<?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>

  location="mysql-connector-java-5.1.47.jar"/>

  <context id="DB2Tables"    targetRuntime="MyBatis3">

    <commentGenerator>

      <property name="suppressDate" value="true"/>

      <property name="suppressAllComments" value="true"/>

    </commentGenerator>

    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:9988/assure_sale?useUnicode=true" userId="assure_sale" password="123456">

    </jdbcConnection>

    <javaTypeResolver>

      <property name="forceBigDecimals" value="false"/>

    </javaTypeResolver>

    <javaModelGenerator targetPackage="lcw.model" targetProject="/Users/humenglong/Desktop/work/baoliang/mybatis">

      <property name="enableSubPackages" value="true"/>

      <property name="trimStrings" value="true"/>

    </javaModelGenerator>

    <sqlMapGenerator targetPackage="lcw.mapping" targetProject="/Users/humenglong/Desktop/work/baoliang/mybatis">

      <property name="enableSubPackages" value="true"/>

    </sqlMapGenerator>

    <javaClientGenerator type="XMLMAPPER" targetPackage="lcw.dao" targetProject="/Users/humenglong/Desktop/work/baoliang/mybatis">

      <property name="enableSubPackages" value="true"/>

    </javaClientGenerator>

    <table tableName="as_plan_approval" domainObjectName="PlanApproval" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"  selectByExampleQueryId="false"></table>

  </context>

</generatorConfiguration>

命令   java -jar mybatis-generator-core-1.4.0.jar -configfile generatorConfig.xml -overwrite

相关文章

网友评论

      本文标题:使用Mybatis-Generator自动生成Dao、Model

      本文链接:https://www.haomeiwen.com/subject/kddydktx.html