ibatis插件的安装方式

安装ibatis插件的方法其实很简单,请按照如下的步骤安装ibatis插件。

 

一.安装ibatis插件

从http://ibatis.apache.org/abator.html下载Eclipse Plugin。插件一共有2种安装方式.

 

1.远程安装ibatis插件.

 

 eclipse->Help>Software Updates>Find and Install->Search for new features to install->

 New Remote Site(name:Abator for Eclipse Update Site ,URL:http://ibatis.apache.org/tools/abator)

 ->OK->Abator for Eclipse Update Site->OK

 

2.手动安装ibatis插件.

 

 http://ibatis.apache.org/abator.html下载AbatorForEclipse1.1.0.zip,下载后在eclipse中进行ibatis插件安装操作。

 eclipse->Help>Software Updates>Find and Install->Search for new features to install(press "Next" )->

 New Local Site->选种刚才下载的文件->OK

 

二.建立一个项目

 

 新建一个Eclipse项目,输入名字,然后选择文件>新建>ABator for iBatis configuration File,选择Location,并且键入File Name:abatorCsonfig.xml。

 

点击“完成”,Eclipse会在程序根目录下建立abatorCsonfig.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 >

    <jdbcConnection driverClass="驱动" connectionURL="数据库URL" userId="用户名" password="密码" >

      <classPathEntry location="数据库驱动jar包" />

    </jdbcConnection>

    <javaModelGenerator targetPackage="model层包路径" targetProject="src路径" />

    <sqlMapGenerator targetPackage="map层包路径" targetProject="src路径" />

    <daoGenerator targetPackage="dao层包路径" targetProject="src路径" type="IBATIS" />

    <table schema="表名" tableName="表名" catalog="数据库名">一定要写上,不然会报错的。

    

    </table>

  </abatorContext>

</abatorConfiguration

 

在abatorCsonfig.xml上点击鼠标右键,选择Generate iBATIS Artifact,在src目录下会生成model、map、dao三个目录,文件也建立好了。

 

 javaModelGenerator:我们常说的ValueObject

 

 sqlMapGenerator:XML文件

 

daoGenerator:放置接口和DAO的代码

 

这样一来,ibatis插件就被顺利的安装上了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值