<?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:数据库的JDBC驱动 -->
<classPathEntry location="WebContent/WEB-INF/lib/postgresql-8.3-607.jdbc4.jar" />
<context id="DB2Tables" targetRuntime="MyBatis3">
<!-- 去除自动生成的注释 -->
<!--
<commentGenerator> <property name="suppressDate" value="true" />
</commentGenerator>
-->
<plugin type="org.mybatis.generator.plugins.RenameExampleClassPlugin">
<property name="searchString" value="Example$" />
<property name="replaceString" value="QueryBean" />
</plugin>
<jdbcConnection driverClass="org.postgresql.Driver"
connectionURL="jdbc:postgresql://xxxxxx/xxxxx" userId="postgres"
password="xxxxx">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- targetProject:自动生成代码的位置 -->
<javaModelGenerator targetPackage="entity"
targetProject="./src/main">
<property name="enableSubPackages" value="false" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="dao" targetProject="./src/main">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER"
targetPackage="dao" targetProject="./src/main">
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- tableName:用于自动生成代码的数据库表;domainObjectName:对应于数据库表的javaBean类名 -->
<table tableName="xxxx" schema="xxxx"
domainObjectName="xxxx" />
</context>
</generatorConfiguration>
然后在Run Configuration里面找到Shell Runner
在Argument里面输入 -configfile ./xxx/config.xml -overwrite