天天看點

mybatis-generator的功能擴充

項目代碼位址:https://github.com/whaiming/java-generator

我在原有的基礎上擴充了和修改了一些功能:

1、增加擷取sqlServer資料庫字段注釋功能

2、Mapper生成接口修改: (1)deleteByExample接口修改為FIsDelete标志删除; (2)deleteByPrimaryKey接口修改為FIsDelete标志删除; (3)insert接口預設不生成; (4)updateByExample接口預設不生成; (5)updateByPrimaryKey接口預設不生成; (6)新增預設生成selectAll接口; (7)新增預設生成selectNotDeleteAll接口; (8)新增預設生成selectNotDeleteByPrimaryKey接口;

3、擴充生成Bo,可選;

4、結合freemarker擴充生成簡單的Service和domain,可選,成對出現: (1)Service預設方法:save,deleteByPrimaryKey,getByPrimaryKey,getNotDeleteByPrimaryKey,findAll,findNotDeleteAll; (2)Domain預設方法:get;

5、結合JavaParser實作了生成的Java代碼的合并(之前生成的Java代碼隻能覆寫原來的)。

繼續閱讀