Use mybatis-generator-gui tool to generate dao, po, mapping files

mybatis-generator-gui is mainly developed based on mybatis generator, which can quickly generate Mybatis Java POJO files and database Mapping files, which simplifies the process of writing Mapping mapping files, and is more efficient and convenient.
1. Modify the path of jdk8 and run the mybatis-generator-gui tool.
This tool uses many features of Java8, so it requires JDK 1.8.0.60 or higher, and JDK 1.8.0.60 or higher is required. After installation, JDK1 is not required. 8's jre does not need to configure environment variables.
Download link : mybatis-generator-gui
extraction code: e3vr
1. Open the start.bat file in the tool directory. This file is a startup file added by yourself), change the value of the javaPath variable to the bin directory of jdk8 jre, as shown in the figure:
Insert picture description here

2. After the modification is completed, double-click to run the start.bat file, and the following interface appears:
Insert picture description here

Second, connect to the database
1. Click the database connection button to create a database connection, enter the connection information, and then click the test connection button, if the connection is successful, click the save button, as shown below:
Insert picture description here

2. After the save is successful, double-click the connection name to open the database, you can view all the tables in the database, then select the table to be generated, fill in the information as needed, and click the code to generate the generated file, as shown in the following figure:
Insert picture description here

3. Click the Open Generate Folder button, find the generated directory, and copy the file to the corresponding directory of the project
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44547592/article/details/110221699