iBATIS的自动代码生成工具Abator在Eclipse的应用

开发 后端
iBATIS的自动代码生成工具Abator在Eclipse的应用是如何的呢?是不是一头雾水呢?那么本文将向你介绍具体的iBATIS的自动代码生成工具Abator在Eclipse里的应用详情。

iBATIS的自动代码生成工具Abator在Eclipse的应用呢首先就是iBATIS的准备:

1、获得 iBATIS

http://ibatis.apache.org/abator.html   

Eclipse可以自动的进行Update获取此Plugin,官方的安装步骤.   
    
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 Site   
 
URL:    

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   
 
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,结果未找到对应的表  
 
简单的配置如下,复杂的见配置文件的详细说明。示例配置文件如下  

  1. ﹤abatorConfiguration﹥     
  2.   ﹤abatorContext﹥         
  3.     ﹤jdbcConnection driverClass="com.microsoft.jdbc.sqlserver.SQLServerDriver"     
  4.         connectionURL="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=whm;SelectMethod=cursor"     
  5.         userId="sa"     
  6.         password="sa"﹥     
  7.       ﹤classPathEntry location="C:/Program Files/Apache Software Foundation/Tomcat 5.0/common/lib/mssqlserver.jar" /﹥     
  8.       ﹤classPathEntry location="C:/Program Files/Apache Software Foundation/Tomcat 5.0/common/lib/msutil.jar" /﹥     
  9.       ﹤classPathEntry location="C:/Program Files/Apache Software Foundation/Tomcat 5.0/common/lib/msbase.jar" /﹥     
  10.     jdbcConnection﹥     
  11.      
  12.     ﹤javaModelGenerator targetPackage="com.dwerp.itatis.domain" targetProject="BhbManage" /﹥     
  13.     ﹤sqlMapGenerator targetPackage="com.dwerp.itatis.persistence.xml" targetProject="BhbManage" /﹥     
  14.     ﹤daoGenerator type="IBATIS" targetPackage="com.dwerp.itatis.persistence.sqlmapdao" targetProject="BhbManage" /﹥     
  15.      
  16.     ﹤table tableName="BHBGL"﹥     
  17.           
  18.     table﹥     
  19.      
  20.   ﹤/abatorContext﹥     
  21. ﹤/abatorConfiguration﹥    

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

iBATIS的自动代码生成工具Abator在Eclipse里的应用就向你介绍到这里,希望对你有所帮助。

【编辑推荐】

  1. iBATIS的优、缺点及注意事项浅谈
  2. iBATIS操作Blob与Clob浅析
  3. iBATIS读写CLOB数据浅析
  4. iBATIS操作CLOB字段实战浅析
  5. iBATIS for Eclipse设置浅析
责任编辑:仲衡 来源: 百度空间
相关推荐

2009-07-14 17:12:26

ibatis自动代码生

2009-07-16 11:40:23

ibatis自动生成abator

2009-07-16 09:09:36

ibatis自动代码

2009-07-16 11:21:19

ibatis主键自动生成

2009-07-16 11:35:57

自动生成ibatis改造

2009-07-14 18:24:31

ibatis映射文件

2009-07-15 17:19:31

iBATIS Ecli

2009-07-17 10:59:59

iBATIS接口

2009-07-21 10:39:19

动态Mapped St

2019-11-05 18:50:37

代码开发工具

2012-04-19 17:16:32

Titanium实例代码分析

2012-07-16 01:41:54

ibatis搭建应用

2009-06-29 17:03:41

自动生成Getter和Eclipse

2009-09-24 16:56:12

Hibernate S

2010-05-06 10:41:43

ibmdwLotusEclipse

2009-07-17 10:32:45

iBATIS MapB

2009-07-22 11:11:39

iBATIS分页实例ObjectDataS

2009-06-29 09:08:12

半自动化ORM实现

2012-05-31 09:14:58

Rexsee

2023-08-29 15:14:32

点赞
收藏

51CTO技术栈公众号