@Select("select * from exam") @Results( { @Result(property = "eId",column = "e_id"), @Result(property ="cId",column = "c_id"), @Result(property = "startTime",column = "start_time"), @Result(property = "endTime",column = "end_time"), @Result(property = "isExist",column = "is_exist"), @Result(property = "content", column = "p_id", javaType = Papers.class, one = @One(select = "com.zz.dao.PaperDao.getPaperContent") ) } ) public List<Exam> selectAll(); @Select("select content from papers WHERE p_id = #{param01}") String getPaperContent(@Param("param01") Integer pId);我使用上述代码出现了 Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for错误 该如何解决
时间: 2023-07-06 12:03:21 浏览: 89
jd_seckill-auto_get_eid_and_fp.zip
这个错误通常是由于MyBatis无法找到匹配的SQL语句导致的。请确保你的Mapper XML文件中包含了名为"getPaperContent"的SQL语句,并且这个SQL语句的id值与@One注解中的select属性值相同。另外,也请确保Mapper接口的namespace与Mapper XML文件中的mapper标签的namespace属性值相同。
阅读全文