• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
山高我为峰
博客园    首页    新随笔    联系   管理    订阅  订阅
MyBatis Generator去掉生成的注解
是不是很讨厌mybatis Generator帮我们生成代码的时候在Mapper和mapper.xml文件中生成的一大堆注解?今天在看MyBatis Generator代码的时候发现,原来mybatis generator是提供了配置注解的能力,配置如下,在generatorConfig.xml中加上配置即可:
 
<commentGenerator>
        <property name="suppressDate" value="true"/>
        <property name="suppressAllComments" value="true" />
</commentGenerator>
suppressDate是去掉生成日期那行注释
suppressAllComments是去掉所有的注解

另外,commentGenerator还可以配置一个type,设置自己的注解生成器,默认使用的是org.mybatis.generator.internal.DefaultCommentGenerator
posted on 2017-12-12 17:38  山高我为峰  阅读(6480)  评论(1)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3