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插件就被顺利的安装上了。

文章题目:ibatis插件的安装方式
当前网址:http://www.shufengxianlan.com/qtweb/news40/439290.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联