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
II. XML configuration file
After it is going to pull open, as shown in
the figure pay attention to fill in their package name
They 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
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
are copied inside the file to your project folder on the OK!