iBator是一个iBatis相关代码的自动生成工具。
1、安装iBator的插件
在Eclipse中,使用添加站点的方法,输入网址http://ibatis.apache.org/tools/ibator,进行iBator的安装。
2、建议不要直接在使用iBatis的项目里直接使用iBator,推荐另外单独建立一个项目来生成。比如,建立一个项目叫:IbatorPrj
3、右键点击IbatorPrj这个项目,如果刚才的插件安装正确的话,就会看到一个“Add iBATOR to the build path”的选项,点击一下。
4、创建iBator的配置文件。下面是我的例子,大家在实际使用的过程中,需要根据自己的情况进行相应的修改。
主要就是数据库JDBC库的路径、数据库驱动的类名、项目的名称、包名等。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ibatorConfiguration
PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN"
"http://ibatis.apache.org/dtd/ibator-config_1_0.dtd">
<ibatorConfiguration>
<classPathEntry location="c:\javaLibs\MySql\mysql-connector-java-5.0.6-bin.jar" />
<ibatorContext id="SampleiBator" targetRuntime="Ibatis2Java5">
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost/sample" userId="root" password="admin">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<javaModelGenerator targetPackage="com.sample"
targetProject="IbatorPrj\src">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.sample.xml"
targetProject="IbatorPrj\src">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<daoGenerator type="GENERIC-CI" targetPackage="com.sample.dao"
targetProject="IbatorPrj\src">
<property name="enableSubPackages" value="true" />
</daoGenerator>
<table schema="sample" tableName="tab1" domainObjectName="JavaBean1">
<property name="useActualColumnNames" value="false" />
<generatedKey column="ID" sqlStatement="MySql" identity="true" />
</table>
</ibatorContext>
</ibatorConfiguration>
5、配置文件生成完毕后,右键点击这个文件,选择“Generate iBatis Artifact”,然后你就在配置的文件夹下找到自动生成的文件了。
相关推荐
开源ibator什么xml和pojo的时候,经常会带一些讨厌的注释还有一些没用的ibatorgenerator等的,我改了它的源代码,弄了个干净的ibator
Ibator is a code generator for iBATIS. Ibator will introspect a database table (or many tables) and will generate iBATIS artifacts that can be used to access the table(s). This abates some of the ...
NULL 博文链接:https://xiao9.iteye.com/blog/954159
NULL 博文链接:https://dr-yanglong.iteye.com/blog/1936559
Spring +ibatis(ibator)+Extjs 项目 架构 例子 说明文档见:
Ibatis 生成器 Ibator 的 API 文档
ibatis 配置文件自动生成工具
iBATIS缓存的使用方法
1:根据svn提交记录选择需要打增量包的文件进行增量,特别提醒:打包前请使用开发工具对项目进行编译,因为打包是拷贝开发工具编译后的class文件。 2:模拟http请求,主要用于接口调。详情使用说明参见本人csdn博客...
iBATIS课件 iBATIS简介 搭建环境 配置文件 读取配置 基本的CRUD操作 模糊查询 iBATIS代码生成工具iBATOR 优缺点 选择Hibernate还是iBATIS
IBATIS3代码生成器 ibatis,Ibator,Abator
ibatis 相关使用文档及安装包ibatis 相关使用文档及安装包
ibatis简易使用ibatis简易使用ibatis简易使用
ibatis自动生成工具使用说明,提高开发效率,规范代码质量
iBATOR is a code generator for iBATIS.
本工程用于研究Ibatis和MySQL结合使用的方法 本工程编码方式:UTF-8 须执行的SQL语句: CREATE DATABASE `test`; USE `test`; DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `id` char(36) NOT NULL...
ibator插件优化的jar包,安装完ibator后,将eclipse\plugins\org.apache.ibatis.ibator.core_1.2.1下的jar包替换即可。
,在本次项目中使用了不少新技术新方法,ibator,aop缓存,sitemesh由于使用了这些新技术使得开发效率有了不小的提升。 现在我向大家介绍一个小工具, ibator-huoniao通过它你可以通过配置少量参数,通过一键生成...
ibatis 自动生成工具 用于生成dao 实体类
修改ibatis不用重启的方法