mybatis逆向工程配置文件

<?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>
<context id="DB2Tables" targetRuntime="MyBatis3">
<!-- 生成mysql带有分页的sql的插件 这个可以自己写,-->

<!-- 自定义的注释规则,继承 DefaultCommentGenerator 重写 一些方法 -->
<commentGenerator >
<!-- 是否去除自动生成日期的注释 true:是 : false:否 -->
<property name="suppressDate" value="true"/>
<!-- 是否去除所有自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>


<jdbcConnection driverClass="com.mysql.jdbc.Driver"

connectionURL="jdbc:mysql:///数据库名?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=true"
userId=" "
password=" ">
</jdbcConnection>
<!-- <jdbcConnection driverClass="oracle.jdbc.OracleDriver"

connectionURL="jdbc:oracle:thin:@127.0.0.1:1521:myoracle"
userId=" "
password=" ">
</jdbcConnection>-->
<!--生成entity类存放位置-->
<javaModelGenerator targetPackage="com.offcn.bean"
targetProject="./src">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!--生成映射文件存放位置-->
<sqlMapGenerator targetPackage="com.offcn.mapper"
targetProject="./src">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!--生成Dao类存放位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.offcn.dao"
targetProject="./src">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="表名"></table>


</context>
</generatorConfiguration>
原文地址:https://www.cnblogs.com/seaWaveQin/p/13153535.html