首先把这三个文件放到一个目录里,我是放到了C盘下的wangbo目录下:

接下来就是设置config.xml文件了,config.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="ojdbc14.jar"/>
<!--修改targetRuntime="MyBatis3"-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:ORADB" userId="xxxxxx" password="xxxxxxxxxxxxxxxxxxx">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- 生成模型的包名和位置-->
<javaModelGenerator targetPackage="test.model" targetProject="C:\wangbo\">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件的包名和位置-->
<sqlMapGenerator targetPackage="test.mapping" targetProject="C:\wangbo\">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置 type="XMLMAPPER"-->
<javaClientGenerator type="XMLMAPPER" targetPackage="test.dao" targetProject="C:\wangbo\">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator> <!-- 要生成哪些表-->
<table tableName="XLW_USER_BRANCH" domainObjectName="UserBranch" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>

下面解释下需要配置的地方:

配置完后打开cmd命令行,进入到配置文件所在的目录下,执行命令就好了:

命令:java -jar mybatis-generator-core-1.3.2.jar -configfile config.xml -overwrite

接下来就生成好了test包:

以上方式是独立于开发工具使用,也可以开发工具插件的形式使用。

IDEA插件方式可参考博客:https://www.cnblogs.com/yjmyzz/p/4210554.html

Eclipse插件方式可参考博客:https://blog.csdn.net/pucao_cug/article/details/64499355

最新文章

  1. php的spl_autoload_register函数的一点个人见解
  2. Tmux 常用命令与快捷键
  3. 《OD学hadoop》第三周0709
  4. 嗯,记录一些eclipse的快捷键
  5. ubuntu-15.04 下编译 ijkplayer 安卓版
  6. 第001篇——C#学习计划开启
  7. 启动程序的c++方法
  8. UVA129 —— Krypton Factor (氪因素)
  9. 876. Middle of the Linked List
  10. 升级centos6.8内核
  11. js 处理 cookie的存储与删除
  12. Python基础-TypeError:takes 2 positional arguments but 3 were given
  13. js中 object.constructor
  14. 关于TensorFlow多种安装方式
  15. Java下载https文件上传到阿里云oss服务器
  16. * args 和 **kwargs
  17. loadrunner11和https
  18. linux find查找并拷贝 exec xargs区别
  19. Layui 好用的弹出框
  20. MongoDB authentication failed

热门文章

  1. Spring.Net配置
  2. mysql简单介绍及安装
  3. Python中的logging模块【转】https://www.cnblogs.com/yelin/p/6600325.html
  4. HTML 5 视频/音频
  5. 2018面向对象程序设计(Java)第18周学习指导及要求
  6. k8s之创建etcd集群
  7. jieba分词/jieba-analysis(java版)
  8. 移动端(处理边距样式)reset.css
  9. [BeijingWc2008]雷涛的小猫
  10. ipcam