posts - 11,  comments - 28,  trackbacks - 0
对初接触者来说,到底如何开始使用abator,资源比较少,本文记载了我今日初次使用的过程,希望对和我一样的初学者有所帮助

获得
      http://ibatis.apache.org/abator.html
     Eclipse可以自动的进行Update获取此Plugin,官方的安装步骤

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:

  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

2、安装好后将在New菜单中看到一个新的文件类型Abator for iBATIS Configuration File,此是Abator的配置文件,配置文件的详细说明见http://ibatis.apache.org/docs/tools/abator/

3、新建一个配置文件,进行修改,根据自己的实际需求进行修改
关键点:
1)jdbcconnection,按照一般的配置即可,需要说明的是它需要指定访问JdbcDriver的classPathEntry,对于MsSqlServer而言,要将这三个jar文件均包含在内,否则会出现jdbc访问错误。
2)配置三个Pakage
3)配置表,此处需说明的是对于MsSqlServer不能写TableSchema,我初次指定TableSchema,结果未找到对应的表
简单的配置如下,复杂的见配置文件的详细说明。示例配置文件如下
<abatorConfiguration>
  <abatorContext>    <!-- TODO: Add Database Connection Information -->
    <jdbcConnection driverClass="com.microsoft.jdbc.sqlserver.SQLServerDriver"
        connectionURL="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=whm;SelectMethod=cursor"
        userId="sa"
        password="sa">
      <classPathEntry location="C:/Program Files/Apache Software Foundation/Tomcat 5.0/common/lib/mssqlserver.jar" />
      <classPathEntry location="C:/Program Files/Apache Software Foundation/Tomcat 5.0/common/lib/msutil.jar" />
      <classPathEntry location="C:/Program Files/Apache Software Foundation/Tomcat 5.0/common/lib/msbase.jar" />
    </jdbcConnection>

    <javaModelGenerator targetPackage="com.dwerp.itatis.domain" targetProject="BhbManage" />
    <sqlMapGenerator targetPackage="com.dwerp.itatis.persistence.xml" targetProject="BhbManage" />
    <daoGenerator type="IBATIS" targetPackage="com.dwerp.itatis.persistence.sqlmapdao" targetProject="BhbManage" />

    <table tableName="BHBGL">
    
    </table>

  </abatorContext>
</abatorConfiguration>

4、右键单击配置文件,点击Generate iBatis Artifacts,生成文件。

 

posted on 2007-01-11 21:37 涤生 阅读(1901) 评论(1)  编辑  收藏


FeedBack:
# re: 如何在Eclipse中使用ibatis的自动代码生成工具Abator
2008-12-17 15:23 | 墙头草
iBatis大全~   回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航:
 
<2007年1月>
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910

常用链接

留言簿(5)

随笔档案

UML

搜索

  •  

最新评论

阅读排行榜

评论排行榜