元素类型为 "mapper" 的内容必须匹配 "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update

Posted JAHC

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了元素类型为 "mapper" 的内容必须匹配 "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update相关的知识,希望对你有一定的参考价值。

在配置ssm框架的时候,写mapper映射文件的时候会出现

元素类型为 "mapper" 的内容必须匹配 "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select)

 

有时候编译的时候会出现这个bug,是因为在前面写了注释。导致了执行顺序的问题。需要把一些注释删掉,就可以正常执行了。

/*mapper动态开发*/
<mapper namespace="com.ssm.mapper.TestSsm">
    
    <select id="testing" parameterType="String" resultType="user">
        select * from user where name = #{name}
    </select>
</mapper>

像这样。我在mapper映射文件前面加了注释。会影响了sql执行的顺序。

以上是关于元素类型为 "mapper" 的内容必须匹配 "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update的主要内容,如果未能解决你的问题,请参考以下文章