mbg:mybatis代码生成器

官网

http://mybatis.org/generator/quickstart.html#

mbg:MyBatis Generator

路径

依然是看着mbg 官网来看,毕竟这个骨骼是最理解的作者给的 :)

    1. Create and fill out a configuration file appropriately (see below for samples)
    1. Save the file in some convenient location (like \temp\generatorConfig.xml)
    1. 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
    1. 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).
    1. After running MBG, you will need to create or modify the standard MyBatis configuration make use of your newly generated code.
  • 整体来说:
  1. classpath引入 mybatis-generator-core-x.x.x.jar
  2. 配置一个xml 生成配置文件
  3. 通过 ant maven ide javacode 调用mbg生成相应的代码
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容