需要在xml配置文檔中添加以下代碼
<!-- 取消注解的生成 -->
<commentGenerator>
<property name="suppressDate" value="true" />
<property name="suppressAllComments" value="true" />
</commentGenerator>
整個xml文檔的配置應匹配以下順序:
property*,plugin*,commentGenerator?,
(connectionFactory|jdbcConnection),
javaTypeResolver?,javaModelGenerator,
sqlMapGenerator?,javaClientGenerator?,table+
如果順序錯亂,會報以下錯誤:
Exception in thread "main" <u>org.mybatis.generator.exception.XMLParserException</u>:
XML Parser Error on line 53: 元素類型為 "context" 的內容必須匹配
"(property*,plugin*,commentGenerator?,(connectionFactory|jdbcConnection),javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+)"。
