IDEA plug-in mybatisx plug-in tutorial

       MybatisX is a rapid development plug-in based on IDEA, which facilitates the simplification of tedious repetitive operations and improves the development speed when developing with mybatis and mybatis-plus.

        The role of MybatisX is to help us automatically create related files of mybatis, eliminating the tedious manual creation!

1. Install the MybatisX plugin

2. Reference related dependencies

3. Connect to MySQL

4. Start using MybatisX, select the data table, configure the path to produce Mybatis files, and produce the final files


1. Install the MybatisX plugin

In the plug-in management, search for Mybatis, MybatisX will be displayed, and then we can click the Install button on the right side of it to install it.

2. Reference related dependencies

I am the SpringBoot framework and introduce the following Pom content

        <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>

3. Connect to MySQL

1. Click "Database"

2. Click the "+" sign, and then select Data Source

3. Among all the data sources displayed. Select Mysql

4. On the displayed data source configuration page, fill in at least 3 items

1) Username

2) Password

3) Database link information

5. After filling in the data source configuration information, there is an additional database display under Database:

6. In the data source Mysql database we added, add the database we need to use.

Click the "0 of 7" position to display all the databases under the Mysql database

We select the database we need to use, and then press the enter key on the keyboard to complete the selection of the database. Then, display something like this:

4. Start using MybatisX, select the data table, configure the path to produce Mybatis files, and produce the final files

1. Select a data table, then "right-click", and select "MybatisX-generator" in the displayed menu

2. Click "MybatisX-generator", the following information is displayed:

Select "Mybatis-Plus3"

Click finish, the final result is as follows:

Guess you like

Origin blog.csdn.net/speedwalkman/article/details/130315296