Invalid bound statement (not found)

Invalid bound statement (not found)

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.conjure.mapper.CategoryMapperCustom.getSubCatList

http://img1.sycdn.imooc.com//climg/5ea4448508e767e915000134.jpg

http://img1.sycdn.imooc.com//climg/5ea44485085aee0715012491.jpg
http://img1.sycdn.imooc.com//climg/5ea444850891832615010623.jpg
http://img1.sycdn.imooc.com//climg/5ea44485088acd5515010217.jpg

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

5回答
一叶梧桐秋 2023-09-18 15:40:27

楼主,我也碰到这问题,你的现在解决了吗

心中有个梦 2020-08-07 11:46:05

是不是需要maven install 一下

xxxycl 2020-05-02 13:48:04

可以看一下org.conjure.pojo.vo.CategoryVO中的那个List是什么吗

提问者 _QhD 2020-04-25 23:16:14

1. mapper namespace 确认无误

namespace="org.conjure.mapper.CategoryMapperCustom"

Copy Reference 得到 "org.conjure.mapper.CategoryMapperCustom"

2. 

<select id="getSubCatList" ...  对比

public List<CategoryVO> getSubCatList(Integer rootCatId);

3. 

resultMap="myCategoryVO" 对比

<resultMap id="myCategoryVO" type="org.conjure.pojo.vo.CategoryVO">

4.

mapper-locations: mapper/*.xml 改为 mapper-locations: classpath:org/conjure/mapper/*.xml


结果还是一样报错:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.conjure.mapper.CategoryMapperCustom.getSubCatList

  • 找不到subcatlist那个方法。你看看有没有被扫描到。肯定哪个细节地方没注意到吧
    2020-04-25 23:23:09
风间影月 2020-04-25 23:11:52

检查你的mapper里是否有重复id

  • 提问者 _QhD #1
    没有重复id <mapper namespace="org.conjure.mapper.CategoryMapperCustom" > <resultMap id="myCategoryVO" type="org.conjure.pojo.vo.CategoryVO"> <id column="id" property="id"/> <result column="name" property="name"/> <result column="type" property="type"/> <result column="fatherId" property="fatherId"/> <!-- collection 标签:用于定义关联的list集合类型的封装规则 property:对应三级分类的list属性名 ofType:集合的类型,三级分类的vo --> <collection property="subCatList" ofType="org.conjure.pojo.vo.SubCategoryVO"> <id column="subId" property="subId"/> <result column="subName" property="subName"/> <result column="subType" property="subType"/> <result column="subFatherId" property="subFatherId"/> </collection> </resultMap> <select id="getSubCatList" resultMap="myCategoryVO" parameterType="int"> SELECT f.id as id, f.`name` as `name`, f.type as type, f.father_id as fatherId, c.id as subId, c.`name` as subName, c.type as subType, c.father_id as subFatherId FROM category f LEFT JOIN category c on f.id = c.father_id WHERE f.father_id = #{rootCatId} </select> </mapper>
    2020-04-25 23:20:22
  • seU 回复 提问者 _QhD #2
    建议你搜索一下 namespace 的包路径 可能是标点符号引起的 我也是这个问题 结果发现是包路径在namespace搜索匹配不了
    2020-08-05 20:42:08
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师