Introduction to 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 initial
nuisance of setting up objects and configuration files to interact with
database tables. iBATOR seeks to make a major impact on the large
percentage of database operations that are simple CRUD (Create,
Retrieve, Update, Delete). You will still need to hand code SQL and
objects for custom queries, or stored procedures.
iBATOR will generate:
- SqlMap XML Files
- Java Classes to match the primary key and fields of the table(s)
- DAO Classes that use the above objects (optional)
iBATOR can run as a standalone JAR file, or as an Ant task, or as an Eclipse plugin.
iBATOR is currently under development. The legacy version (Abator)
is still available. If you have suggestions for the future of iBATOR,
please feel free to send them to the Java user's mailing list..
About the Name
iBATOR is an iBATIS stylized version of the English word "abator". Abator means "one who abates a nuisance".
iBATOR News
(April 14, 2008) Due to a trade registration dispute, Abator is
renamed to iBATOR. iBATOR is currently under development. The initial
source code drop can be checked out from SVN at http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/
(March 20, 2008) Updated Abator and the Eclipse plugin to version
1.1.0. This is an extensive update that includes quite a few minor
enhancements, two major enhancements (two new methods can be
generated), and a few bug fixes. See the What's New? section of the
online documentation for full details.
(August 20, 2006) Updated Abator and the Eclipse plugin to version
1.0.0. This is an extensive update that includes many new features
including the ability to generate code for Java 5, generate different
types of domain models, and hugely improved "by example" methods. See
the "What's New?" section of the online documentation for full details.
iBATOR Development
iBATOR is currently under development. iBATOR will not be 100%
compatible with Abator, but will be very close. Known differences
include:
- iBATOR requires JRE version 5.0 or higher
- iBATOR generates code that depends on iBATIS version 2.2.0 or higher
- iBATOR does not include the Legacy generator set from Abator
- The format of the XML configuration file is slightly different and abator* elements are renamed to ibator*.
The code generated by iBATOR will be 100% compatible with code
generated by Abator. We are simply taking this opportunity to clean up
some of the API that is a little cumbersome.
Legacy Abator Software Downloads and Documentation
Download the standalone JAR if you are using an IDE other than
Eclipse. The standalone JAR includes an Ant task to run Abator, or you
can run Abator from the command line of from Java code.
- Abator 1.1.0 w/Binaries and Source
Documentation for the core functions of Abator is available online.
This documentation set is also included in the downloads, and is
integrated into the Eclipse help system if you are using the Eclipse
plugin.
Documentation for the Eclipse specific features is integrated into the Eclipse help system and is not available online.
Eclipse Plugin
When run as an Eclipse plugin, Abator will persist the generated
Java classes and SqlMap files in Eclipse projects. Abator can be run
iteratively multiple time as the database design matures - and any hand
coded additions to generated Java classes or SqlMap files will remain
undisturbed.
Documentation for Abator is integrated into the Eclipse help system.
Requirements
- Eclipse 3.2 or higher (Note: if you are stuck on Eclipse
3.0, or version 6.0 of the Rational development tools, the prior
version of the plugin is still available on the update site)
- JDK 1.4 or Higher
Automatic Eclipse Install
If you've already installed a prior version of Abator, simply run
the Eclipse Install/Update tool and the new version will be found
automatically.
If you've not already installed Abator, then you can use the built in Eclipse install support by following these steps:
- Take the "Help>Software Updates>Find and Install" Menu Option
- Select the "Search for new features to install" radio button, press "Next"
- Press the "New Remote Site" button
- Enter the following information: Name:Abator for Eclipse Update SiteURL:http://ibatis.apache.org/tools/abator
- Press OK
- Check the box next to "Abator for Eclipse Update Site"
- Follow the remainder of the install wizard
Manual Eclipse Install
The automatic install is much preferred, but you can also install
Abator manually if you desire. To install manually, download the file
AbatorForEclipse1.1.0.zip and unzip the file to some convenient
location. After unzipping the update site archive, follow these steps
in Eclipse:
- Take the "Help>Software Updates>Find and Install" Menu Option
- Select the "Search for new features to install" radio button, press "Next"
- Press the "New Local Site" button
- Navigate to the location where you unzipped the file.
- Press OK
- Follow the remainder of the install wizard
配置文件abatorConfig.xml示例
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN"
"http://ibatis.apache.org/dtd/abator-config_1_0.dtd">
<abatorConfiguration>
<abatorContext> <!-- TODO: Add Database Connection Information -->
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@192.168.0.17:1521/fcg"
userId="fcg"
password="fcg">
<classPathEntry location="E:\Tomcat6.0\lib\ojdbc14-10.2.0.1.0.jar" />
</jdbcConnection>
<javaTypeResolver >
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!--
<javaModelGenerator targetPackage="abator" targetProject="FCG\test">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="abator" targetProject="FCG\test">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<daoGenerator type="SPRING" targetPackage="abator" targetProject="FCG\test">
<property name="enableSubPackages" value="true" />
</daoGenerator>
<table schema="fcg" tableName="users" domainObjectName="User" >
<property name="useActualColumnNames" value="true"/>
<generatedKey column="ID" sqlStatement="DB2" identity="true" />
<columnOverride column="DATE_FIELD" property="startDate" />
<ignoreColumn column="FRED" />
<columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" />
</table>-->
<!-- -->
<javaModelGenerator targetPackage="abator" targetProject="FCG\test" />
<sqlMapGenerator targetPackage="abator" targetProject="FCG\test" />
<daoGenerator type="SPRING" targetPackage="abator" targetProject="FCG\test" />
<!--
<table tableName="USERS" />
<table tableName="COMPONENTS" />
<table tableName="ROLES" />
<table tableName="RESOURCES" />-->
<table tableName="import_railroad_fee_check" />
</abatorContext>
</abatorConfiguration>
1下载插件for eclipse
2将配置文件放入src根目录
3更改数据库路径,ojbdc路径
4在test目录下建立abator目录
5 tableName修改为需要自动生成代码的表名
6 在配置文件上右键,会出现生成代码的选项
分享到:
相关推荐
IBATIS3代码生成器 ibatis,Ibator,Abator
NULL 博文链接:https://xiao9.iteye.com/blog/954159
开源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 ...
ibator-huoniao通过它你可以通过配置少量参数,通过一键生成dao层的全部文件,能够应付对dao层的所有操作 产物包括: 1. pojo文件 2. dao接口类 3. dao接口实现类文件 4. ibatis sql map文件 5. 数据库查询时...
ibatis ibator eclipes插件 代码生成器 代码自动生成工具 下载后将features和plugins两个文件夹下的文件拷贝到eclipes安装路径下对应的features和plugins两个文件夹下即可
此项目通过对ibator的改造,通过执行cmd命令自动生成sql与Dao,大大提高开发效率
NULL 博文链接:https://dr-yanglong.iteye.com/blog/1936559
eclipse的ibatis代码生成器,最新版ibator 1.2.1
iBATOR is a code generator for iBATIS.
ibatis3的自动代码生成工具ibator参考文档,快速开发dao的好东西。
自动生成dto\dao\xml 自带批处理自动生成程序
ibatis 配置文件自动生成工具
ibatis代码自动生成工具Eclipse插件,已进行优化处理,不生成注释和精简dao方法,亲测可用
用户ibatis自动成才代码的一种工具,减少开发人员的工作量。
下载完之后会得到一个jar文件,然后将这个文件拷贝到eclipse安装目录的dropins文件夹下,重启eclipse(如果没有 打开直接打开即可)
ibator_doc.chm iBatis的自动生成工具!
ibator1.2.2多了点功能,具体可以百度,重新编译了下,生成注释去掉了
GameServer一个服务器处理框架,包括 协议处理,消息处理,持久层数据...来对服务器的管理使用ibatis做持久层采用ibator做自动代码生成工具,减少开发中对数据库编码的工作量使用mina2.0.9做网络通信提供网络通信的性
ibator插件优化的jar包,安装完ibator后,将eclipse\plugins\org.apache.ibatis.ibator.core_1.2.1下的jar包替换即可。