Mybatis Reverse Engineering Tutorials

Mybatis Reverse Engineering Tutorials

Summary: Mybatis reverse engineering, automatic generation of entity classes we project the data table corresponding to, DAO, Mapper file, the correct rate, eliminating unnecessary trouble, saving time cost, rapid development tool.

First, download the official website Mybatis compressed, as shown in directory format after decompression
is not Src directory if extracting, manually create your own
src folder Dao will be stored automatically generated entity classes and mapping class
If decompression is not Src directory, manually create your own
II. XML configuration file

Here Insert Picture Description
After it is going to pull open, as shown in
Here Insert Picture Description
the figure pay attention to fill in their package name

Here Insert Picture DescriptionThey need to fill in the table name to the TableName and DomainObjectName at the figure;
note Tablename is to show, DomainObjectName is the class name is capitalized projects in need.

III. Open the generated statement .TXT
Here Insert Picture Description

Copy the code inside, then close the Txt file, in this page is the root of your reverse engineering, has been holding down Shift, right at the same time, find the console options, just copy and paste the code in the console, enter run, OK

Then you go Src directory you will find entity classes needed for the project, Dao layer, layer mapping
Here Insert Picture Description
are copied inside the file to your project folder on the OK!

Published 13 original articles · won praise 8 · views 1314

Guess you like

Origin blog.csdn.net/yaoliyuan0922/article/details/83549894