前端之家收集整理的这篇文章主要介绍了
generator.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>
<!-- 指定数据连接驱动jar地址 -->
<classPathEntry location="E:/jars/generator_tool/ojdbc14.jar" />
<context id="my" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressAllComments" value="false" /><!-- 是否取消注释 -->
<property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳 -->
</commentGenerator>
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@60.191.250.12:1521:ORCL" userId="scweb"
password="scweb" />
<!-- 生成实体类地址 -->
<javaModelGenerator targetPackage="com.credit.entity"
targetProject="E:/workspaces/new_space/DBHandler/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 生成mapxml文件 -->
<sqlMapGenerator targetPackage="com.credit.dao.oracle"
targetProject="E:/workspaces/new_space/DBHandler/src/main/java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- 生成mapxml对应client,也就是接口dao -->
<javaClientGenerator targetPackage="com.credit.dao.oracle"
targetProject="E:/workspaces/new_space/DBHandler/src/main/java" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<table schema="YWXY" tableName="SYSTEM_DICTTYPE"
domainObjectName="DICTTYPE" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample
是否生成 example类 -->
<!-- 忽略列,不生成bean 字段 -->
<!--<ignoreColumn column="FRED" /> -->
<!-- 指定列的java数据类型 -->
<!--<columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" /> -->
</table>
</context>
</generatorConfiguration>