一款自动生成mybatis dto、dao、config的工具

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

<classPathEntrylocation="mysql-connector-java-5.1.6.jar"/>

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

<commentGenerator>

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

扫描二维码关注公众号,回复: 809897 查看本文章

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

</commentGenerator>

<!-- 这里配置连接数据库 -->

<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://10.6.222.59:3307/fpsapdb" userId="fpsap" password="fpsap123">

</jdbcConnection>

<javaTypeResolver>

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

</javaTypeResolver>

<!-- 配置要生成的DTO的目录 -->

<javaModelGenerator targetPackage="cn.webank.cnc.of.model" targetProject="src">

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

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

</javaModelGenerator>

<!-- 配置要生成的mapping config的目录 -->

<sqlMapGenerator targetPackage="cn.webank.cnc.of.mapping" targetProject="src">

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

</sqlMapGenerator>

<!-- 配置要生成的DAO的目录 -->

<javaClientGenerator type="XMLMAPPER" targetPackage="cn.webank.cnc.of.mybatis.dao" targetProject="src">

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

</javaClientGenerator>

<!-- 配置要生成的表明以及对应的DTO名称 -->

<table tableName="SUBJECT_RELATION" domainObjectName="SubjectRelation" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>

</context>

</generatorConfiguration>

猜你喜欢

转载自godsend-jin.iteye.com/blog/2221906
今日推荐