官网
mbg:MyBatis Generator
路径
依然是看着mbg 官网来看,毕竟这个骨骼是最理解的作者给的 :)
- Create and fill out a configuration file appropriately (see below for samples)
 
- Save the file in some convenient location (like \temp\generatorConfig.xml)
 
- Run MBG from the command line with a command like this:
 
java -jar mybatis-generator-core-x.x.x.jar -configfile \temp\generatorConfig.xml -overwrite
- This will tell MBG to run using your configuration file. It will also tell MBG to overwrite any existing Java or Kotlin files with the same name. If you want to save any existing files, then omit the -overwrite parameter. If there is a conflict, MBG will save the newly generated file with a unique name (e.g. MyClass.java.1).
 
- After running MBG, you will need to create or modify the standard MyBatis configuration make use of your newly generated code.
 
- 整体来说:
 
- classpath引入 mybatis-generator-core-x.x.x.jar
 - 配置一个xml 生成配置文件
 - 通过 ant maven ide javacode 调用mbg生成相应的代码