<?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>
<!-- targetRuntime:执行生成逆向工程的版本
MyBatis3Simple 生成基本的CRUD(简洁版)
MyBatis3 生成代条件的CRUD(比较复杂一点)
-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<!-- 数据源配置 -->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/ssm?serverTimezone=UTC"
userId="root"
password="root"
>
</jdbcConnection>
<!-- Bean的生成策略 -->
<javaModelGenerator targetPackage="com.shuyepl.mybatis.pojo" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- SQL映射文件生成策略 -->
<sqlMapGenerator targetPackage="com.shuyepl.mybatis.mapper" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- Mapper接口生成策略 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.shuyepl.mybatis.mapper" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!--
逆向分析的表
tableName设置为*可以对应所有的表,这是可以不用写domainObjectName
domainObjectName指定生成类的名称为什么
-->
<table tableName="t_emp" domainObjectName="Emp" />
<table tableName="t_dept" domainObjectName="Dept" />
</context>
</generatorConfiguration>
标签:逆向,配置,配置文件,解释,跑通,MyBatis
From: https://www.cnblogs.com/shuyepl/p/17385230.html