今天,进行Mybatis的动态查询测试的时候出现了
Result Maps collection does not contain value for 。。。。。错误
查看了网上的资料,讲解的很细致说的有可能是namespace配置错误。
<mapper namespace="com.demo.mybatis.testMapper">
看了一下不是,又看了下第二种方法说的是
出现这个错误 主要是因为你的select标签内部的resultMap属性 指向的不正确
果然就是这个错误 因为我没有配置resultMap所以导致了找不到。
// 看下 引用的 resultMap 是否正确
<select id="selectByParam" resultMap="BaseResultMap">
SELECT
*
FROM test
WHERE id = #{id}
</select>