使用Mybatis Generator自动生成Model,Mapper.java,Mapper.xml文件
一、首先在Eclipse安装Mybatis Generator插件help—> Eclipse Markeplace -> 搜索Mybatis Generator,然后点击Install,等待安装好
二、在项目下建一个generatorConfig.xml,内容如下:
<?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="E:\Company\Tool\maven\m2\repository\com\oracle\ojdbc6\11.2.0.3\ojdbc6-11.2.0.3.jar" />
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<!-- 是否警告 -->
<property name="suppressTypeWarnings" value="false" />
<!-- 是否去除自动生成的注释 true:是 : false: