zl程序教程

您现在的位置是:首页 >  Javascript

当前栏目

Eclipse MyBatis1.4.2 generatorConfig 默认不生成XML文件,加了type="XMLMAPPER"也不起作用,解决方法

2023-03-14 22:57:41 时间

可以结合的上一遍文章一起看:
https://developer.aliyun.com/article/1067864?spm=a2c6h.26396819.creator-center.12.f1883e18uYUf9m

1、主要是查了javaClientGenerator的说明:If the targetRuntime is MyBatis3 the following predefined values can be used:
如下图,答案很明了了,如果想 type="XMLMAPPER"生效就必须在 添加targetRuntime 是MyBatis3
image.png

2、在generatorConfig的context 元素增加targetRuntime="MyBatis3"

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

image.png

再运行,问题解决!