IDEA插件之mybatisx插件使用教程(超詳細(xì)!)

MybatisX 是一款基于 IDEA 的快速開(kāi)發(fā)插件,方便在使用mybatis以及mybatis-plus開(kāi)發(fā)時(shí)簡(jiǎn)化繁瑣的重復(fù)操作,提高開(kāi)發(fā)速率。

MybatisX的作用就是幫助我們自動(dòng)化建立mybatis的相關(guān)文件,免去手動(dòng)建立的繁瑣!文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

一、安裝MybatisX插件

在插件管理中,搜索Mybatis,就會(huì)顯示MybatisX,然后我們點(diǎn)擊它右側(cè)的Install按鈕,就能安裝了。文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-1文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

二、引用相關(guān)的依賴(lài)

本人是SpringBoot框架,引入如下Pom內(nèi)容文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.1</version>
</dependency>

三、連接MySQL

1、點(diǎn)擊“Database”文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

2、點(diǎn)擊“+”號(hào),然后選擇Data Source文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

3、在顯示的所有數(shù)據(jù)源中。選擇Mysql文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-2文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

4、在顯示的數(shù)據(jù)源配置頁(yè)面,至少填寫(xiě)3項(xiàng)內(nèi)容文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

1)用戶名文章源自四五設(shè)計(jì)網(wǎng)-http://www.4968ejs.cn/35263.html

2)密碼

3)數(shù)據(jù)庫(kù)鏈接信息

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-3

5、填寫(xiě)完數(shù)據(jù)源配置信息后,在Database下面多出了一個(gè)數(shù)據(jù)庫(kù)顯示:

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-4

6、在我們添加的數(shù)據(jù)源Mysql數(shù)據(jù)庫(kù)中,添加我們需要使用的數(shù)據(jù)庫(kù)。

點(diǎn)擊“0 of 7”這個(gè)位置,顯示了該Mysql數(shù)據(jù)庫(kù)下面所有的數(shù)據(jù)庫(kù)

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-5

我們選中其中我們需要使用的數(shù)據(jù)庫(kù),然后按鍵盤(pán)上的enter鍵,就會(huì)完成數(shù)據(jù)庫(kù)的選中工作。然后,顯示如下內(nèi)容:

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-6

四、開(kāi)始使用MybatisX,選擇數(shù)據(jù)表,配置生產(chǎn)Mybatis文件的路徑,生產(chǎn)最后的文件

1. 選擇一個(gè)數(shù)據(jù)表,然后“右點(diǎn)擊”,在顯示的菜單中選擇“MybatisX-generator”

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-7

2. 點(diǎn)擊“MybatisX-generator”,顯示如下信息:

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-8

選擇 “Mybatis-Plus3”

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-9

點(diǎn)擊finish,最后結(jié)果如下:

IDEA插件之mybatisx插件使用教程(超詳細(xì)!)-10

繼續(xù)閱讀
我的微信
微信掃一掃
weinxin
我的微信
惠生活福利社
微信掃一掃
weinxin
我的公眾號(hào)
 
  • mybatisx

發(fā)表評(píng)論

匿名網(wǎng)友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖動(dòng)滑塊以完成驗(yàn)證