用ibator eclipse 插件自动生成sqlmap

[url]http://pure.iteye.com/blog/441845[/url]


在新项目中用到了ibatis,如果手写sqlmap和model是很烦的事情,幸好有ibator插件来减轻工作量。

ibator可以生成dao、model、 sqlmap

首先是安装ibator插件:

Eclipse update url

[url] http://ibatis.apache.org/tools/ibator[/url]

安装完后,新建ibatorConfig.xml文件


[img]http://dl.iteye.com/upload/attachment/0084/5381/72df5909-9262-3337-a083-f9c1f8cdadfd.jpg[/img]

修改生成的配置文件


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" >
<ibatorConfiguration>
<classPathEntry location="D:\\dev\\eclipse\\workspace\\gserver\\lib\\mysql-connector-java-5.1.7-bin.jar" />
<ibatorContext id="context1">
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/xxxx" userId="root"
password="mysql" />
<javaModelGenerator targetPackage="com.pure.model"
targetProject="mytest" />
<sqlMapGenerator targetPackage="com.pure.maps"
targetProject="mytest" />
<daoGenerator targetPackage="com.pure.dao" targetProject="mytest"/>
<table tableName="player">
</table>
</ibatorContext>
</ibatorConfiguration>




[b]选中 ibatorConfig.xml 右键Generate iBATIS Artifacts.[/b]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值