mbg:mybatis代碼生成器

官網(wǎng)

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

mbg:MyBatis Generator

路徑

依然是看著mbg 官網(wǎng)來看,畢竟這個骨骼是最理解的作者給的 :)

    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 調(diào)用mbg生成相應的代碼
最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容