MyBatis Generator自动生成MyBatis的映射代码
2016-04-29 09:02
423 查看
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安装即可
2.创建MyBatis Generator配置文档
File->New->Other...
如图所示新建MyBatis Generator配置文档,按提示创建好即可
3.修改配置值
网址:http://mybatis.github.io/generator/configreference/xmlconfig.html有示例配置及详细的标签介绍,如图所示:
4.运行及结果展示
在该文件右键执行即可,如图所示:
相关文章推荐
- 图文详解Java环境变量配置方法
- C#中的集合用法分析
- 解析Java程序中对象内存的分配和控制的基本方法
- 队列(顺序存储)代码
- polygon-Graveyard(poj3154)
- LinkedList详解
- 简单学习Python time模块
- QT学习之 布局管理
- JVM内存的设置(解决eclipse下out of memory问题)
- JAVAEE项目结构以及并发随想
- java项目中经常碰到的内存溢出问题: java.lang.OutOfMemoryError: PermGen space, 堆内存和非堆内存,写的很好,理解很方便
- java中LinkedList的实现
- Java开发中的23种设计模式详解(转)
- ArrayList类详解
- java初学者:构造方法 技术文章
- JDBC(Java Data Base Connectivity)
- spring大文件分块上传原理解析
- 序列化与反序列化
- 在Java里处理文件的技巧
- java基础练习题