eclipse中mybatis generator插件的安装与使用,实现自动生成代码
git地址:https://github.com/mybatis/generator
下载后解压:

选择任意一个版本的jar放到eclipse的features目录下即可

选择任意一个版本的jar放到eclipse的plugins目录下即可

重启eclispe
需要mybatis-generator-core.jar
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.2</version>
<scope>test</scope>
</dependency>
右键-new,会有MyBatis,在指定项目目录下生成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>
<!-- oracle lib location -->
<classPathEntry location="E:\backup\repository\mysql\mysql-connector-java\5.1.40\mysql-connector-java-5.1.40.jar" />
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressAllComments" value="true" />
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.1.2:3306/palm_2_0_16" userId="root"
password="sqj888">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver> <!-- model package and location -->
<javaModelGenerator targetPackage="cn.zsmy.entity" targetProject="palmdoctor.code\src\main\java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- mapping package and location -->
<sqlMapGenerator targetPackage="cn.zsmy.mapper" targetProject="palmdoctor.code\src\main\java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- dao package and location -->
<javaClientGenerator type="XMLMAPPER" targetPackage="cn.zsmy.mapper" targetProject="palmdoctor.code\src\main\java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator> <table tableName="tb_hello" domainObjectName="Hello"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false" /> </context>
</generatorConfiguration>
已存在generatorConfig.xml就不需要新建了,也可以直接copy的。



没报错就是成功了
去掉Mybatis Generator生成的一堆 example
原文:http://www.cnblogs.com/lyh421/p/5672569.html
<table schema="general" tableName="tb_table_name" domainObjectName="EntityName"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
<property name="useActualColumnNames" value="true"/>
</table>
我的修改:

eclipse中mybatis generator插件的安装与使用,实现自动生成代码的更多相关文章
- 2016.7.12 eclipse和IDEA中mybatis generator插件的安装与使用
Eclipse中的安装 http://jingyan.baidu.com/article/9faa7231506ed8473c28cbee.html 1.下载插件 2.将插件generator的fea ...
- Eclipse 使用mybatis generator插件自动生成代码
Eclipse 使用mybatis generator插件自动生成代码 标签: mybatis 2016-12-07 15:10 5247人阅读 评论(0) 收藏 举报 .embody{ paddin ...
- eclipse中的aptana插件的安装
先下载 aptana插件包 我安装的eclipse版本是 indido版本号的. 三步骤: 1.将aptana解压到eclipse的目录下 2.打开eclipse目录下的dropins文件,新建一 ...
- IDEA结合mybatis插件自动生成代码
pom文件 添加插件 <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>myb ...
- Eclipse MyBatis Generator插件安装
目录 Eclipse MyBatis Generator插件安装 Eclipse MyBatis Generator插件安装 1.进入Eclipse Marketplace [Help] -> ...
- mybatis generator 插件安装及使用
现在Mybatis特别火,但是在开发中却要经常写实体类和配置文件,会不会特别烦人,所以可以利用Mybatis的代码生成插件来生成这部分代码: 1,打开eclipse,点击Help>Softwar ...
- Windows下安装Python及Eclipse中配置PyDev插件
最近开始接触Python,鉴于之前安装Java的教训,决定这次边安装Python,边写下历程,供日后反复使用. 在Python官网http://www.python.org/下载Python版本,鉴于 ...
- Myeclipse2014添加mybatis generator插件
Myeclipse2014把mybatis generator插件直接放在dropins文件夹下,重启后不能成功安装mybatis插件. 既然离线安装不成功,可以选择在线安装 1.选择 Help-&g ...
- 通过eclipse mybatis generater代码生成插件自动生成代码
Mybatis属于半自动ORM,在使用这个框架中,工作量最大的就是书写Mapping的映射文件,由于手动书写很容易出错,我们可以利用Mybatis-Generator来帮我们自动生成文件.通过在Ecl ...
随机推荐
- export、export default、module.export区别
在es6里面定义模块,导出模块时可以使用export.export default 这2者区别: 在同一个文件里面可以有多个export, 一个文件里面只能有1个export default //a. ...
- [转]9个基于Java的搜索引擎框架
9个基于Java的搜索引擎框架 在这个信息相当繁杂的互联网时代,我们已经学会了如何利用搜索引擎这个强大的利器来找寻目标信息,比如你会在Google上搜索情人节如何讨女朋友欢心,你也会在百度上寻找正规的 ...
- Python+Selenium练习篇之2-利用ID定位元素
在前面一篇文章,我们介绍了如何摘取页面字段,通过正则进行匹配符合要求的字段.如果感觉有点困难,不能立马理解,没有关系.把字符串摘取放到第一篇,是因为自动化测试脚本,经常要利用字符串操作,字符串切割,查 ...
- Mac: mac git 的安装 及实现自动补全
1.检查是否装了brew $ brew list 如果没有,拷贝以下命令到终端 回车.可以安装好brewruby -e "$(curl -fsSL https://raw.githubuse ...
- python学习_常用语句
1.变量 1 name='hu qihang' #变量名应为英文,方便阅读 2 name_of_gf='chen ye' #多个单词用下划线隔开 3 名字='hu qihang' #变量名可以是中文 ...
- 小谈Bing桌面、Bing助手的现状与发展
Teamwork中我的工作,既然写了就直接放上来吧. 一.Bing搜索的相关背景 第一,必应搜索前几年的发展重点在于欧美市场,并且取得了一定的成效:根据 Hitwise 的统计数据,Bing 在 20 ...
- hihoCoder 1133 二分·二分查找之k小数(TOP K算法)
#1133 : 二分·二分查找之k小数 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 在上一回里我们知道Nettle在玩<艦これ>,Nettle的镇守府有很 ...
- [luogu_P2045]方格取数加强版
[luogu_P2045]方格取数加强版 试题描述 给出一个 \(n \times n\) 的矩阵,每一格有一个非负整数 \(A_{i,j},(A_{i,j} \le 1000)\) 现在从 \((1 ...
- 洛谷P3045 [USACO12FEB]牛券Cow Coupons
P3045 [USACO12FEB]牛券Cow Coupons 71通过 248提交 题目提供者洛谷OnlineJudge 标签USACO2012云端 难度提高+/省选- 时空限制1s / 128MB ...
- Bzoj2829 信用卡凸包
Time Limit: 10 Sec Memory Limit: 128 MBSec Special JudgeSubmit: 333 Solved: 155 Description Input ...