MyBatis needs to use mybatis-generator-core-1.3.2.jar , database connection driver package and an xml file to generate code. The general command of xml file is : generator.xml .
The Xml content format is as follows:
After configuring the xml , use the dos command to enter the folder and execute the java command:
D:\generator>java -jar mybatis-generator-core-1.3.2.jar -configfile generator.xml –overwrite
My D:\generator> here is the address where mybatis-generator-core-1.3.2.jar , database connection driver package and an xml file are stored on my computer . You can modify it according to the actual location when you use it.
When it appears: MyBatis Generator finished successfully. , the generated code is successful
Also refer to: http://www.autojcode.com/index.html
http://blog.csdn.net/zhshulin/article/details/23912615