mybatis automatic code generation tool (reverse engineering)

MyBatis automatically generated entity class (reverse engineering)

MyBatis part of a semi-automatic ORM framework, it needs to write sql statement and mapping files ourselves, but to write the mapping file and sql statement error prone, so mybatis official provided Generator generator, automatic DAO interface. Entity classes and Mapping. The generator is automatically generated according to a single table of code necessary to execute the mybatis, therefore, must first create a database table, and then automatically generate code.

-------- default has been designed databases and tables (if not design data and design tables please databases and tables)

1. automatically generate code code generator

Download: https: //github.com/michael-deve/common.git

2. decompression, opened its lib directory

3.lib directory contains the code generator generate code and required mybatis jar package mysql

4. do is modify generatorConfig.xml file

 

5. The contents of the above file comments below modify the relevant content for their project on it

6. file after you modify, you need to execute script code generation console (you can also hold down the shift + right mouse button to open the window powershell here in the lib directory)

Open the console into the implementation of java -jar mybatis-generator-core- 1.3.2.jar -configfile generatorConfig.xml -overwrite lib directory

 

7. After the successful implementation of the relevant code is generated in the directory of your own definition

 

Guess you like

Origin www.cnblogs.com/michaelcnblogs/p/11333031.html