使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件(转)
来源:互联网 发布:java常见面试题及答案 编辑:程序博客网 时间:2024/05/21 11:10
mybatis generator 可以提高开发速度,这个插件可以自动生成代码,创建DAO层相关代码,就像利用HIbernate反相生成一样,安装前可以先到百度网盘下载:
文件:MyBatisGenerator
地址:http://pan.baidu.com/s/1c0cjDEK 或者 http://pan.baidu.com/s/1o713HoA
1、适用于环境:
WIN7
eclipse
mybatis3
2、下载好MyBatis_Generator_1.3.1.zip.zip文件解压后,放到MyEclipse目录下dropins,以link方式安装,如下:
3、重启一下MyEclipse,提示安装成功!
http://jingyan.baidu.com/album/9faa7231506ed8473c28cbee.html?picindex=6
4、新建generatorConfig.xml 文件:
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" ><generatorConfiguration ><classPathEntry location="D:\Workspaces\MyDemo\MyBatis_Demo\WebRoot\WEB-INF\lib\mysql-connector-java-5.1.6-bin.jar" /> <context id="context1" > <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/mybatis" userId="root" password="root" /> <javaModelGenerator targetPackage="me.gacl.model" targetProject="MyBatis_Demo" /> <sqlMapGenerator targetPackage="me.gacl.model" targetProject="MyBatis_Demo" /> <javaClientGenerator targetPackage="me.gacl.model" targetProject="MyBatis_Demo" type="XMLMAPPER" /> <table schema="" tableName="case_tag" domainObjectName="CaseTag" ></table> </context></generatorConfiguration>
5、配置好上面文件后,
选择"generatorConfig.xml" 文件,右键 Generator Mybats/ Ibats... 将会生成对应的内容,然后根据项目需求再手动修改相关生成后的文件。
0 0
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件
- web前端开发技术入门
- codevs 3116 高精度练习之加法
- EventBus3.0使用
- 反编译android_apk
- android学习第二周_布局优化技巧及列表控件_学习笔记
- 使用Mybatis-Generator自动生成Dao、Model、Mapping相关文件(转)
- Eclipse中10个最有用的快捷键组合
- 太原网络营销师揭秘每个老板最头疼的百度竞价(SEM)如何提供转化率?
- Java源码之ConcurrentHashMap
- 【PHP笔记】 zend常用数据结构及宏
- Linux 前后台进程切换
- 我也读读从0到1
- 回归树-----生成回归树
- 235. Lowest Common Ancestor of a Binary Search Tree