天天看點

mybatis generator 中文注釋_mybatis開發 —— 快速生成開發代碼

一,mybatis example 形式代碼

編寫 generator.xml檔案

<?
           

配置好上述檔案之後,打開CMD指令行 ,java -jar mybatis-generator-core-1.3.2.jar -configfile generator.xml -overwrite

mybatis generator 中文注釋_mybatis開發 —— 快速生成開發代碼

連結: https://pan.baidu.com/s/1aXR9dd_DfHAHG-86ipCxrA 提取碼: k7bp

記得這些檔案需要放在沒有中文的檔案夾路徑,否則會報錯,上述的src檔案夾,為generator.xml配置的src位置。這樣子即可一鍵生成mapper,model,example的代碼。

二,mybatisplus Wrapper condition形式代碼

pom引入需要的包

<
           
import 
           

mybatisplus 更加簡單,将上述代碼進行main函數運作即可生成各個子產品的代碼。