项目使用mybatis,使用的动态sql的方式、
<sql id="whereSQL">
<if test="id != null">
and t.id = #{id}
</if>
</sql>
使用的时候
<include refid="whereSQL"/>
但是一直提示XML fragments parsed from previous mappers does not contain value for member.whereSQL,后来发现是版本问题,mybatis3.0.x的版本,mybatis-spring1.0.0就有问题,升级mybatis-spring1.0.0为mybatis-spring1.0.1就行了、
本文介绍了一种在使用MyBatis动态SQL时遇到的问题及解决方案,详细讲述了如何通过升级mybatis-spring版本从1.0.0到1.0.1来解决XML碎片解析错误,确保动态SQL片段正确引用。

3477

被折叠的 条评论
为什么被折叠?



