【SSM】SSM学习笔记(4):取消MyBatis Generator注解的生成,解决[元素类型为 "context" 的内容必须匹配 "...]的问题


MyBatis Generator官方文档中的相关内容

需要在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+)"。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM