在用Id查询时发现所报的异常的记录下来
异常如下:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.usian.mapper.CategoryMapper.FindCategroyById'. It's likely that neither a Result Type nor a Result Map was specified.
at
代码:
Category FindCategroyById(Integer cid);
<select id="FindCategroyById" parameterType="int">
select cname from category where cid = #{cid}
</select>
错误原因:
在配置Mapper文件时没有配置resultType属性 再返回类型时无法正确的返回所报的错误