配置文件注意:
<?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>
<classPathEntry location="mysql-connector-java-6.0.5.jar" />
<context id="mysql">
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/name?serverTimezone=UTC" userId="#" password="#" />
<javaModelGenerator targetPackage="com" targetProject="mybatis-generator-core-1.3.6/lib" />
<sqlMapGenerator targetPackage="com" targetProject="mybatis-generator-core-1.3.6/lib" />
<javaClientGenerator targetPackage="com" targetProject="mybatis-generator-core-1.3.6/lib" type="XMLMAPPER" />
<table tableName="tb_sys_log" domainObjectName="tbSysLog" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
生成语句: java -jar mybatis-generator-core-1.3.6.jar -configfile generatorConfig.xml -overwrite