MyBatis Generator generatorConfig.xml配置详解
来源:互联网 发布:淘宝双十一的营销策略 编辑:程序博客网 时间:2024/06/05 06:36
所有Generator的xml详细说明见:http://mybatis.org/generator/configreference/xmlconfig.html (英文版)
<?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><!-- 引入配置文件 --><properties resource="init.properties"/><!-- 指定数据连接驱动jar地址 --><classPathEntry location="${classPath}" /><!-- 一个数据库一个context --><context id="infoGuardian"><!-- 注释 --><commentGenerator ><property name="suppressAllComments" value="false"/><!-- 是否取消注释 --><property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳--></commentGenerator><!-- jdbc连接 --><jdbcConnection driverClass="${jdbc_driver}"connectionURL="${jdbc_url}" userId="${jdbc_user}"password="${jdbc_password}" /><!-- 类型转换 --><javaTypeResolver><!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) --><property name="forceBigDecimals" value="false"/></javaTypeResolver><!-- 生成实体类地址 --><javaModelGenerator targetPackage="com.oop.eksp.user.model"targetProject="${project}" ><!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] --><property name="enableSubPackages" value="false"/><!-- 是否针对string类型的字段在set的时候进行trim调用 --><property name="trimStrings" value="true"/></javaModelGenerator><!-- 生成mapxml文件 --><sqlMapGenerator targetPackage="com.oop.eksp.user.data"targetProject="${project}" ><!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] --><property name="enableSubPackages" value="false" /></sqlMapGenerator><!-- 生成mapxml对应client,也就是接口dao --><javaClientGenerator targetPackage="com.oop.eksp.user.data"targetProject="${project}" type="XMLMAPPER" ><!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] --><property name="enableSubPackages" value="false" /></javaClientGenerator><!-- 配置表信息 --><table schema="${jdbc_user}" tableName="s_user"domainObjectName="UserEntity" enableCountByExample="false"enableDeleteByExample="false" enableSelectByExample="false"enableUpdateByExample="false"><!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample 是否生成 example类 --><!-- 忽略列,不生成bean 字段 --><ignoreColumn column="FRED" /><!-- 指定列的java数据类型 --> <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" /></table></context></generatorConfiguration>
附带上我的init.properties
#Mybatis Generator configurationproject = EKSPclassPath=E:/workplace/EKSP/WebContent/WEB-INF/lib/ojdbc14.jarjdbc_driver = oracle.jdbc.driver.OracleDriverjdbc_url=jdbc:oracle:thin:@127.0.0.1:1521:orcljdbc_user=INFOGUARDIANjdbc_password=info_idap132
0 0
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis Generator generatorConfig.xml配置详解
- MyBatis generator generatorConfig.xml Maven配置
- MyBatis Generator generatorConfig.xml的配置
- MyBatis Generator generatorConfig.xml的配置
- 【MyBatis】MyBatis Generator插件自动生成文件,generatorConfig.xml配置详解
- Android4.4深入浅出之SurfaceFlinger与Client通信框架(一)
- windows消息和消息队列
- 抓包工具
- 拓扑排序
- HDUJ 1047 Integer Inquiry
- MyBatis Generator generatorConfig.xml配置详解
- Spring 两个核心技术
- 在学校学了3年,用了半年多的as3
- pdf转换器哪个简单好用
- 云计算技术背后的天才程序员:Open VSwitch鼻祖Martin Casado
- poj2528-Mayor's posters
- 简单制作Makefile 文件
- A009: 使用__future__
- Parse error: syntax error, unexpected end of file in ..\..\functions.php on line 1246