使用Eclipse3.2(MyEclipse)+ abator自动生成iBatis代码以及配置文件的方法
2010-08-29 19:42
1281 查看
使用Eclipse3.2(MyEclipse)+ abator自动生成iBatis代码以及配置文件的方法
转自:http://hi.baidu.com/ecspell/blog/item/1af66e811e4626dbbc3e1efd.html
注意:http://ibatis.apache.org/tools/abator 对应的是eclipse3.2 ;我在myeclipse6.0(eclipse3.3)上没用试验成功
一.安装插件Abator
Abator for Eclipse Update Site
This is the Abator for Eclipse update site. If you're not sure what Abator is, then see this page http://ibatis.apache.org/abator.html
If you've already installed a prior version of Abator for Eclipse, then simply run the Eclipse Install/Update tool and any 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:
1. Take the "Help>Software Updates>Find and Install" Menu Option
2. Select the "Search for new features to install" radio button, press "Next"
3. Press the "New Remote Site" button
4. Enter the following information:
Name:
Abator for Eclipse Update Site
URL:
http://ibatis.apache.org/tools/abator
5. Press OK
6. Check the box next to "Abator for Eclipse Update Site"
7. Follow the remainder of the install wizard
3、插件完成后,建立一个项目ibatisTest,然后选择文件>新建>ABator for iBatis configuration File,默认文件名,点击“完成”。修改刚才的文件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:@localhost:1521:orcl"
userId="spell"
password="spell">
<classPathEntry location="G:/techinfo/javaLib/DB_Jar/oracle/classes12.jar" />
</jdbcConnection>
<javaModelGenerator targetPackage="com.spell.model" targetProject="ibatisTest/src" />
<sqlMapGenerator targetPackage="com.spell.map" targetProject="ibatisTest/src" />
<daoGenerator type="IBATIS" targetPackage="com.spell.dao" targetProject="ibatisTest/src" />
<table schema="SPELL" tableName="members" catalog="members">
</table>
</abatorContext>
</abatorConfiguration>
5、 在abatorConfig.xml上点击鼠标右键,选择Generate iBATIS Artifact,在src目录下会生成com.spell.model、com.spell.map、com.spell.dao三个目录,文件也建立好了。 其他有什么要修改的就自己动手吧~~
转自:http://hi.baidu.com/ecspell/blog/item/1af66e811e4626dbbc3e1efd.html
注意:http://ibatis.apache.org/tools/abator 对应的是eclipse3.2 ;我在myeclipse6.0(eclipse3.3)上没用试验成功
一.安装插件Abator
Abator for Eclipse Update Site
This is the Abator for Eclipse update site. If you're not sure what Abator is, then see this page http://ibatis.apache.org/abator.html
If you've already installed a prior version of Abator for Eclipse, then simply run the Eclipse Install/Update tool and any 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:
1. Take the "Help>Software Updates>Find and Install" Menu Option
2. Select the "Search for new features to install" radio button, press "Next"
3. Press the "New Remote Site" button
4. Enter the following information:
Name:
Abator for Eclipse Update Site
URL:
http://ibatis.apache.org/tools/abator
5. Press OK
6. Check the box next to "Abator for Eclipse Update Site"
7. Follow the remainder of the install wizard
3、插件完成后,建立一个项目ibatisTest,然后选择文件>新建>ABator for iBatis configuration File,默认文件名,点击“完成”。修改刚才的文件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:@localhost:1521:orcl"
userId="spell"
password="spell">
<classPathEntry location="G:/techinfo/javaLib/DB_Jar/oracle/classes12.jar" />
</jdbcConnection>
<javaModelGenerator targetPackage="com.spell.model" targetProject="ibatisTest/src" />
<sqlMapGenerator targetPackage="com.spell.map" targetProject="ibatisTest/src" />
<daoGenerator type="IBATIS" targetPackage="com.spell.dao" targetProject="ibatisTest/src" />
<table schema="SPELL" tableName="members" catalog="members">
</table>
</abatorContext>
</abatorConfiguration>
5、 在abatorConfig.xml上点击鼠标右键,选择Generate iBATIS Artifact,在src目录下会生成com.spell.model、com.spell.map、com.spell.dao三个目录,文件也建立好了。 其他有什么要修改的就自己动手吧~~
相关文章推荐
- Eclipse(MyEclipse)生成iBatis代码以及配置文件
- 如何在Eclipse中使用ibatis的自动代码生成工具Abator
- 在Myeclipse中完成代码自动填充,自动提示功能的方法:以及如何在导入和导出配置文件。
- ibatis自动生成工具,abator使用方法
- 使用Eclipse的Generator MyBatis/iBatis Artifacts插件自动生成代码,与spring集成
- Eclipse导入颜色配置文件导致代码自动提示功能失效的解决方法
- 使用abator自动生成ibatis代码的经验
- XML形式的配置文件解析框架以及自动代码生成(一)
- 使用svcutil工具自动生成wcf调用的客户端代码和配置文件
- ibatis - 自动代码生成工具abator 使用介绍
- eclipse develop for C\C++ 文件注释函数注释代码模板自动生成方法
- ibatis - 自动代码生成工具abator 使用介绍
- eclipse修改java代码或者其他一些资源例如配置文件,freemarker文件时tomcat不自动重启的方法
- ibatis - 自动代码生成工具abator 使用介绍(s00n原作)
- 使用abator自动生成ibatis代码碰到的问题及解决方案
- 使用eclipse开发spring,hibernate,mybatis等框架的xml配置文件时代码不自动提示
- 使用Abator自动生成ibatis的DAO.Model.mapper.xml方法使用说明
- Myeclipse2015 Jrebel插件的安装、配置、使用(新建.java文件、给类添加新方法、新属性、修改代码等,不用重启tomcat即可更新)
- 解决Eclipse项目有红感叹号的方法以及clean完没有自动生成R文件的方法
- ibatis - 自动代码生成工具abator 使用介绍