一、MyBatis @Many注解报错:Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ActionClassifyDAO.selectxxx
二、报错代码如下:
@Select({
"select",
"id, name",
"from system_dict",
"where parent_id = 1" })
@Results({
@Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
@Result(column = "name", property = "name", jdbcType = JdbcType.VARCHAR),
@Result(property = "classfyDatalist", javaType = List.class, column = "id",
many = @Many(select = "ActionClassifyDAO.selectActionClassifcationByParentId", fetchType = FetchType.EAGER))
})
三、报错原因:
因为@Many注解中的select属性 设置的方法ActionClassifyDAO.selectActionClassifcationByParentId 没有加上包名。导致报错,估计是因为近期进行了一次包结构调整的原因删除了部分包结构导致的。
四、解决:
包结构加上了之后,就能顺利运行了。