1、在项目的src/main/resources新建MyBatis-Generator的配置文件,如命名为mybatis-generator.xml,其内容如下:
![](https://img-blog.csdn.net/20180411223756662?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZlbmcxNTkzOTE3ODkwNg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
<?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:豪华版 -->
<context id="MyBatisGenerator" targetRuntime="MyBatis3">
<!-- 生成的实体Bean,将实现Serializable -->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<commentGenerator>
<!-- 是否去除自动生成的注释 true:是 ; false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- jdbcConnection:连接数据库 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localho