a2005147 发表于 2016-11-27 08:08:30

Eclipse的mybatis插件generator配置文件示例

<?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="D:/work/soft/apache-maven-3.0.4/local/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar" />
<context id="context1">
<commentGenerator>
<!-- 避免生成注释 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- 数据库连接信息 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/pl_member" userId="root"
password="root" />
<!-- Model文件保存位置,targetProject为myeclipse重的项目名加java包根路径 -->
<javaModelGenerator targetPackage="com.px.model"
targetProject="webdemo/src" />
<!-- 生成的mapper文件 -->
<sqlMapGenerator targetPackage="com.px.mapper"
targetProject="webdemo/src" />
<!-- 生成的查询条件的类 -->
<javaClientGenerator targetPackage="com.px.client"
targetProject="webdemo/src" type="XMLMAPPER" />
<!-- 需要连接的表(不生成Example(帮助类)类) -->
<table tableName="hotelinfo" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <columnOverride column="???" property="???" /> -->
</table>
</context>
</generatorConfiguration>
页: [1]
查看完整版本: Eclipse的mybatis插件generator配置文件示例