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
英文地址,請注明出處:http://en.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…