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

mybatis generator自动生成的代码里老是有一堆example,需要改的时候,generatorConfig.xml文件的配置的方法如下:
<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插件的安装与使用,实现自动生成代码相关推荐

  1. MBG真香 Spring Boot集成Mybatis Generator插件

    Mybatis中文官网对mybatis-generator的介绍:http://www.mybatis.cn/archives/885.html Mybatis官网对mybatis-generator ...

  2. Eclipse集成Mybatis Generator及应用

      说明:xxxPo-xxxPoMapper-xxPoMapper.xml 都是典型的体力活,好在有很多插件可以帮我们去完成这些复制粘贴的工作,这里就从两方面1.Eclipse集成mybatis ge ...

  3. Myeclipse中安装mybatis generator插件有两种方式,一种是在线安装,一种是离线安装。

    一.在线安装:Help------>MyEclipse Configuration Center,选择add site,填入MyBatis generator插件的地址: http://myba ...

  4. Eclipse使用mybatis generator自动生成代码

    一.写在前面 Mybatis属于半自动ORM,在使用这个框架中,工作量最大的就是书写Mapping的映射文件,由于手动书写很容易出错,我们可以利用Mybatis-Generator来帮我们自动生成文件 ...

  5. Springboot—mysql+mybatis+generator插件

    1.idea-generatorConfig.xml <?xml version="1.0" encoding="UTF-8"?> <!DOC ...

  6. MyEclipse添加Mybatis generator插件

    进入MyEclipse Configuration Center选择add site,填入MyBatis generator插件的地址:http://mybatis.googlecode.com/sv ...

  7. SpringBoot入门篇--整合mybatis+generator自动生成代码+druid连接池+PageHelper分页插件

    我们这一一篇博客讲的是如何整合Springboot和Mybatis框架,然后使用generator自动生成mapper,pojo等文件.然后再使用阿里巴巴提供的开源连接池druid,这个连接池的好处我 ...

  8. eclipse中下载spring-tool-suite插件遇到的问题

    eclipse中下载spring-tool-suite插件遇到的问题 我的eclipse的版本4.7.0,接下来以下载我的eclipse的对应STS版本3.8.4为例,讲一下遇到的问题.不同版本的ec ...

  9. eclipse中的javaEE插件

    eclipse中的javaEE插件 1.在Eclipse中菜单help选项中选择install new software选项 2.在work with 栏中输入 Juno - http://downl ...

最新文章

  1. Win7下Event_Log服务4201错误的有效解决方法
  2. vb6中使text控件的光标随着增加的内容向下移动
  3. 使用SAP云平台Portal service的前置条件
  4. linux如果一个目录具有执行,Linux操作系统部分复习题答案
  5. Hive中的数据库、表、数据与HDFS的对应关系
  6. 力扣501. 二叉搜索树中的众数(JavaScript)
  7. (PHP 4, PHP 5) isset — 检测变量是否设置
  8. Atitit  自动化gui 与 发帖机 技术
  9. 【Codeforces Round #317 Div1 —— A】Lengthening Sticks【数学思维题】
  10. 华为最新解bl解锁码计算工具_黔隆科技刷机教程红米note4X低配版忘记密码刷机解锁降级救砖解屏幕锁账户锁教程...
  11. java__斐波那契数列
  12. 大数据管理平台-数据处理与数据集市
  13. s7scan 安装使用教程
  14. 澳洲留学生面经,Java后端,阿里、头条、百度、华为、微策略
  15. 添加五笔输入法(默认的)windows sever 2012 r2
  16. c语言求数组中绝对值最小值,c语言中求绝对值的数学函数
  17. 第二期腾讯AI加速器将面向全球招募AI创业者
  18. app.run 相关参数 flask配置文件
  19. 计算机软件工作室起名'',半永久工作室名字大全
  20. Python 医学知识图谱问答系统(一),建立医学知识图谱,基于neo4j知识图谱的医学问答体系

热门文章

  1. 黄冈学计算机的学校怎么样,黄冈学计算机的学校
  2. mysql8.0连接错误_MySql 8.0连接失败
  3. C语言霍夫曼编码压缩,数据结构大作业——哈夫曼编码压缩BMP格式文件
  4. 服务器linux换windows,【服务器运维】如何将linux体系更换成windows体系
  5. 每个选项设置上限的投票_使用Redis有序集合实现投票排行榜系统
  6. python做自动化界面_使用Python进行自动化测试如何切换窗口
  7. promise A+ 原理
  8. mysql maratadb_Mysql/Mairadb主从复制
  9. cmk聪明客机器人餐厅_晒晒我家85平新房,餐厅装修的太漂亮了,儿童房飘窗更实用!...
  10. 腾讯云服务器CentOs7系统发布个人网站