编写generatorConfing代码
<?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>
<!--数据库驱动路径,一定要引用本地的驱动包,否则会报找不到mysql driver class-->
<classPathEntry location="D:\JAVA\maven\repositories\mysql\mysql-connector-java\5.0.4\mysql-connector-java-5.0.4.jar" />
<context id="context1">
<commentGenerator>
<!-- 删除代码中带有 代码生成器的注释信息 -->
<property name="suppressAllComments" value="true" />
<property name="suppressDate" value="true" />
</commentGenerator>
<jdbcConnection connectionURL="jdbc:mysql://192.168.1.103:3306/mydb" driverClass="com.mysql.jdbc.Driver" password="rootroot" userId="root" />
<javaModelGenerator targetPackage="com.plg.shiro.entity" targetProject="springmvc-mybatis-shiro/src/main/java" />
<sqlMapGenerator targetPackage="mapper" targetProject="springmvc-mybatis-shiro/src/main/resources" />
<javaClientGenerator targetPackage="com.plg.shiro.dao" targetProject="springmvc-mybatis-shiro/src/main/java" type="XMLMAPPER" />
<table tableName=""></table>
<!-- <table tableName="om_menu" schema="" enableSelectByExample="false" enableDeleteByExample="false" enableCountByExample="false" enableUpdateByExample="fasle" /> -->
</context>
</generatorConfiguration>
运行generatorConfing代码