mybatis自动生成表的配置文件
来源:互联网 发布:行而知天下 编辑:程序博客网 时间:2024/06/05 21:15
<?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="./lib/ojdbc6.jar" />
<context id="DB2Tables" targetRuntime="MyBatis3">
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin" />
<plugin type="org.mybatis.generator.plugins.SerializablePlugin" />
<plugin type="org.mybatis.generator.plugins.CaseInsensitiveLikePlugin" />
<plugin type="org.mybatis.generator.plugins.RenameExampleClassPlugin">
<property name="searchString" value="Example$" />
<property name="replaceString" value="Criteria" />
</plugin>
<plugin type="org.mybatis.generator.plugins.MapperConfigPlugin">
<property name="fileName" value="sqlMapConfig-temp.xml" /><!-- 生成xml文件的目录-->
<property name="targetPackage" value="config.mybatis" /><!--文件夹路径-->
<property name="targetProject" value="../resources/" /><!--sqlMapConfig-temp.xml 的路径-->
</plugin>
<commentGenerator>
<property name="suppressDate" value="true" />
<!-- 去除自动生成的注释 -->
<property name="suppressAllComments" value="false" />
</commentGenerator>
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"<连接数据库>
connectionURL="jdbc:oracle:thin:@127.0.0.1:1521:orcl" userId="orcl"
password="oracle11">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="true" />
</javaTypeResolver>
<javaModelGenerator targetPackage="com.mybatisgenerator.model"<!--生成model-->
targetProject="../src/">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="sqlmap.base"<!--生成mapper.xml文件-->
targetProject="../resources/">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER"<!--生成mapper.java文件-->
implementationPackage="com.mybatisgenerator.mapper" targetPackage="com.mybatisgenerator.mapper"
targetProject="../src/">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<table tableName="T_DISCOUNT_COUPON" domainObjectName="DiscountCoupon"<!--表名,文件前缀名-->
enableCountByExample="true" enableDeleteByExample="true"
enableSelectByExample="true" enableUpdateByExample="true" >
<generatedKey column="COUPON_ID" sqlStatement="select DISCOUNT_COUPON_SEQ.NEXTVAL from DUAL" identity="false" /> <!--主键和表序列查询-->
</table>
</context>
</generatorConfiguration>
genarator.xml<!--执行文件-->
<?xml version="1.0" encoding="UTF-8"?>
<project name="Mybatis-Generator" default="default" basedir=".">
<target name="default" depends="genfiles-all" />
<target name="genfiles-all" description="Generate the files">
<taskdef name="mbgenerator" classname="org.mybatis.generator.ant.GeneratorAntTask"
classpath="../web/WEB-INF/classes;./lib/mybatis-generator-core-1.3.1.jar;./lib/mybatis-3.1.0.jar" /><!--jar包的引用-->
<mbgenerator overwrite="true" configfile="config/config.xml" <!--引用config.xml文件-->
verbose="false">
</mbgenerator>
</target>
</project>
demo路径http://download.csdn.net/detail/strutce/8916389
- mybatis自动生成表的配置文件
- mybatis 自动生成配置文件
- Mybatis generator 自动生成配置文件
- Mybatis代码自动生成配置文件
- mybatis-generator自动生成java代码和配置文件的注意事项
- SSM利用mybatis-generator自动生成代码-表对应的类和配置文件
- Mybatis自动生成Mapper工具配置文件
- mybatis自动生成代码xml配置文件
- mybatis自动生成 实体类、接口、配置文件
- 使用generator自动生成Mybatis映射配置文件
- 使用mybatis自动生成工具,生成对应的类,配置文件,接口
- MyBatis自动生成表对应的类
- 基于表的mybatis代码自动生成
- MyBatis自动生成的语句
- mybatis的自动生成插件
- hibernate配置文件 自动生成表
- Mybatis使用generator自动生成映射配置文件信息
- Mybatis使用generator自动生成映射配置文件信息
- iOS开发系列--通讯录、蓝牙、内购、GameCenter、iCloud、Passbook系统服务开发汇总
- 使用MG-SOFT的MIB Builder编写mib文件或者.my文件方法
- 黑马程序员----JAVA基础----集合
- 基于Jpcap的Java ARP断网攻击
- 内联函数的讲解
- mybatis自动生成表的配置文件
- HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包,经典入门题)
- 将图片文件流转换成base64字符串
- 2012年5月SAT香港真题解析
- GRE写作必备句型
- sublime text2 插件 zencoding的安装及使用
- 日志管理--log4j
- POJ 1008 Maya Calendar
- backtrace&&backtrace_symbols 查找段错误 打印堆栈信息