`
pure
  • 浏览: 350687 次
社区版块
存档分类
最新评论

用ibator eclipse 插件自动生成sqlmap

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

ibator可以生成dao、model、 sqlmap

首先是安装ibator插件:

Eclipse update url

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

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


修改生成的配置文件

<?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>
  • 大小: 38.4 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics