MyBatis Generator自动生成MyBatis的映射代码

MyBatis Generator自动生成MyBatis的映射代码

MyBatis Generator大大简化了MyBatis的数据库的代码编写,有了一个配置文件,就可以直接根据表映射成实体类、Dao类和xml映射。
资源地址:
MyBatis项目地址:
http://mybatis.github.io/
MyBatis中文使用文档:http://mybatis.github.io/mybatis-3/zh/index.html
MyBatis Generator使用文档:http://mybatis.github.io/generator/index.html
MyBatis Generator的Eclipse插件地址:http://mybatis.googlecode.com/svn/sub-projects/generator/trunk/eclipse/UpdateSite/

1.在Eclipse中安装MyBatis Generator插件
Help->Install New Software输入插件地址:
http://mybatis.googlecode.com/svn/sub-projects/generator/trunk/eclipse/UpdateSite/,如下图所示,一路Next安装即可

MyBatis <wbr>Generator自动生成MyBatis的映射代码

2.创建MyBatis Generator配置文档
File->New->Other...
如图所示新建MyBatis Generator配置文档,按提示创建好即可

MyBatis <wbr>Generator自动生成MyBatis的映射代码

3.修改配置值
网址:
http://mybatis.github.io/generator/configreference/xmlconfig.html有示例配置及详细的标签介绍,如图所示:

MyBatis <wbr>Generator自动生成MyBatis的映射代码

4.运行及结果展示
在该文件右键执行即可,如图所示:

MyBatis <wbr>Generator自动生成MyBatis的映射代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值