Mybatis-Generator自动生成XML文件以及接口和实体类

 

 

 

整合了MySQL和Oracle配置文件生成方法

这个是整个文件夹的下载地址:http://www.codepeople.cn/download

主要给大家介绍一下generatorConfig.xml文件的配置,以及生成后的文件。

generatorConfig.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration><!--数据库驱动--><classPathEntry    location="mysql-connector-java-8.0.11.jar"/><context id="DB2Tables"    targetRuntime="MyBatis3"><commentGenerator><property name="suppressDate" value="true"/><property name="suppressAllComments" value="true"/></commentGenerator><!--数据库链接地址账号密码,主要Mysql版本,高版本的Mysql要加上时区--><jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/seezoon-framework?serverTimezone=GMT%2B8" userId="root" password="root"></jdbcConnection><javaTypeResolver><property name="forceBigDecimals" value="false"/></javaTypeResolver><!--生成Model类存放位置--><javaModelGenerator targetPackage="lcw.model" targetProject="src"><property name="enableSubPackages" value="true"/><property name="trimStrings" value="true"/></javaModelGenerator><!--生成映射文件存放位置--><sqlMapGenerator targetPackage="lcw.mapping" targetProject="src"><property name="enableSubPackages" value="true"/></sqlMapGenerator><!--生成Dao类存放位置--><javaClientGenerator type="XMLMAPPER" targetPackage="lcw.dao" targetProject="src"><property name="enableSubPackages" value="true"/></javaClientGenerator><!--生成对应表及类名enableCountByExample设置为false的意思就是xml中不生成这个方法和接口--><table tableName="sys_dept" domainObjectName="SysDept" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table><table tableName="sys_user" domainObjectName="SysUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table></context>
</generatorConfiguration>

然后在cmd命令行下进入到Mybatis-Generator所在的目录,然后执行命令:

java -jar mybatis-generator-core-1.3.7.jar -configfile generatorConfig.xml -overwrite

然后生成文件在src目录下,可自行查看。

转载于:https://www.cnblogs.com/lr393993507/p/9565768.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/news/279503.shtml
繁体地址,请注明出处:http://hk.pswp.cn/news/279503.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何在Windows 10上设置默认Linux发行版

Windows 10 now allows you to install multiple Linux environments, starting with the Fall Creators Update. If you have multiple Linux environments, you can set your default and switch between them. Windows 10现在允许您从Fall Creators Update开始安装多个Linux…

mysql全备份+增量备份笔记总结

备份基础知识 冷备&#xff08;cold backup&#xff09;&#xff1a;需要关mysql服务&#xff0c;读写请求均不允许状态下进行&#xff1b; 温备&#xff08;warm backup&#xff09;&#xff1a; 服务在线&#xff0c;但仅支持读请求&#xff0c;不允许写请求&#xff1b; 热备…

pjax学习

PJAX 介绍 红薯 发布于 2012/04/11 22:06阅读 61K收藏 116评论 11jQuery.Pjax kissy开发四年只会写业务代码&#xff0c;分布式高并发都不会还做程序员&#xff1f;->>> 介绍 pushState是一个可以操作history的api&#xff0c;该api的介绍和使用请见这里&#xff1a…

SQL Server 2000详细安装过程及配置

说明&#xff1a;这篇文章是几年前我发布在网易博客当中的原创文章&#xff0c;但由于网易博客现在要停止运营了&#xff0c;所以我就把这篇文章搬了过来&#xff0c;虽然现如今SQL Server 2000软件早已经过时了&#xff0c;但仍然有一部分人在使用它&#xff0c;尤其是某些高校…

移动应用ios和网页应用_如何在iOS上一次移动多个应用

移动应用ios和网页应用Apple doesn’t really believe in detailed instruction manuals, so some handy tricks slip through the cracks. One such trick we’ve recently discovered is that you can move multiple app icons at once on iOS. Here’s how. Apple并不真正相…

如何将内核静态库编译连接到驱动程序中去【转】

转自&#xff1a;http://blog.csdn.net/ganjianfeng2003/article/details/8089551 如何将内核静态库编译连接到驱动程序中去 2010-12-07 08:27 331人阅读 评论(1) 收藏 举报 http://blog.chinaunix.net/u2/61663/showart_2404744.html 刚上邮箱的时候发现一位网友向我询问这个问…

2018-2019 20165226 Exp9 Web安全基础

2018-2019 20165226 Exp9 Web安全基础 目录 一、实验内容说明及基础问题回答 二、实验过程 Webgoat准备XSS攻击 ① Phishing with XSS 跨站脚本钓鱼攻击② Stored XSS Attacks 存储型XSS攻击③ Reflected XSS Attacks 反射型XSS攻击 CSRF攻击 ① Cross Site Request Forgery(CS…

用 git 同步 Colab 与 Gitlab、Github 之间的文件

Colab 是谷歌提供的免费 Jupyter 服务&#xff0c;可使用 GPU。但由于每次的 VM &#xff08;虚拟机&#xff09;登出后所有文件都会连同&#xff36;&#xff2d;被毁掉。如何将一个项目里的程序或数据同步到 Colab则往往比较麻烦。尽管谷歌盘也可以挂到 Colab 里用&#xff0…

keep-alive使用_如何使用Google Keep进行无忧笔记

keep-alive使用There are a lot of note-taking apps out there. Google Keep may not be as powerful as services like Evernote, but its value is in its simplicity. Let’s talk about how to make the most of it. 那里有很多笔记应用程序。 Google Keep可能不如Evernot…

ZedGraph在项目中的应用

ZedGraph在项目中的应用将数据库数据提取出来&#xff0c;显示成曲线图&#xff08;饼状、柱状或立体图&#xff09;是项目中最常见的需求。 网上搜索到的解决方法&#xff0c;大多归为两类&#xff0c;一种是利用ActiveX组件&#xff0c;另一种是使用.net框架自带的画图的类。…

TCP/IP:IP多播选路

本节主要讨论多播选路&#xff0c;是在整个互联网上的多播&#xff0c;我们将讨论mrouted程序的执行&#xff0c;该程序计算多播路由表&#xff0c;以及再网络之间转发多播数据包的内核函数。 多播输出处理 这个和IGMP的输出处理类似&#xff0c;主要要注意有环回的多播输出和没…

Leetcode#832. Flipping an Image(翻转图像)

题目描述 给定一个二进制矩阵 A&#xff0c;我们想先水平翻转图像&#xff0c;然后反转图像并返回结果。 水平翻转图片就是将图片的每一行都进行翻转&#xff0c;即逆序。例如&#xff0c;水平翻转 [1, 1, 0] 的结果是 [0, 1, 1]。 反转图片的意思是图片中的 0 全部被 1 替换&a…

数据安全 数据销毁_如何安全销毁敏感数据CD / DVD?

数据安全 数据销毁You have a pile of DVDs with sensitive information on them and you need to safely and effectively dispose of them so no data recovery is possible. What’s the most safe and efficient way to get the job done? 您有一堆DVD&#xff0c;上面有敏…

cannot find -lunwind-x86_64

错误代码&#xff1a;; }) libtool: install: /usr/bin/install -c .libs/libunwind.lai /usr/local/lib/libunwind.la libtool: install: warning: relinking libunwind-setjmp.la libtool: install: (cd /down/libunwind-1.0/src; /bin/sh /down/libunwind-1.0/libtool --…

动态切换父元素隐藏和显示里面的子元素的动画会再一次执行吗?

代码&#xff1a;完整代码:<!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title></title> <style type"text/css"> *{ margin: 0; padding: 0; } .box{ background-color: #00B83F; } .flag{ position…

MAD huashi

name1 input("请输入一个名字") name2 input("请输入一个名词") name3 input("请输入一个形容词") name4 input("请输入一个名字") name5 input("请输入一个名字") name6 input("请输入一个长辈名字") name…

如何使用QuickConnect远程访问Synology NAS

Your Synology NAS includes a QuickConnect feature that lets you access its DiskStation Manager interface remotely. Here’s how to set it up. Synology NAS包含快速连接功能&#xff0c;可让您远程访问其DiskStation Manager界面。 设置方法如下。 You were likely gr…

深入MySQL存储引擎分析锁和排序的原理

几个问题 为什么不建议使用订单号作为主键?为什么要在需要排序的字段上加索引?for update 的记录不存在会导致锁住全表?redolog 和 binlog 有什么区别?MySQL 如何回滚一条 sql ?char(50) 和 varchar(50) 效果是一样的么?索引知识回顾 对于 MySQL 数据库而言,数据是存储在…

网络编程介绍

1. 目标:编写一个C/S架构的软件 C/S: Client--------基于网络----------Server B/S: Browser-------基于网络----------Server2. 服务端需要遵循的原则: 1. 服务端与客户端都需要有唯一的地址,但是服务端的地址必须固定/绑定 2. 对外一直提供服务,稳定运行 3. 服…

[Web开发] MySpace 发布开发接口

2007年风头最盛的Web 2.0公司应该就是Facebook &#xff0c;其一炮走红的绝招就是它的开发平台。 开发者可以为Facebook 加入各种插件&#xff0c;丰富Facebook 。为了对抗 Facebook &#xff0c; 社交网站的老大Myspace 也推出了自己开发平台 http://developer.myspace.com/c…