MyBatis Generator关于注释的生成

来源:互联网 发布:中国禁毒网络知识竞赛 编辑:程序博客网 时间:2024/06/07 03:20

mybatis Generator生成代码的时候在Mapper和mapper.xml文件中生成的一大堆注解。mybatis generator是提供了配置注解的能力,在generatorConfig.xml中加上配置:

<commentGenerator>        <property name="suppressDate" value="true"/>        <property name="suppressAllComments" value="true" /> </commentGenerator>

suppressDate是去掉生成日期那行注释;
suppressAllComments是去掉所有的注释;


commentGenerator默认使用的是org.mybatis.generator.internal.DefaultCommentGenerator生成注解,通过配置type,可以设置自己的注释生成器。

原创粉丝点击