org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

背景信息:

谷粒商城项目中自建mapper方法,手写sql语句时报错

运行时报错:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.atguigu.gulimall.product.dao.AttrAttrgroupRelationDao.deleteRelations
    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.2.jar:3.5.2]
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.<init>(MybatisMapperMethod.java:49) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.lambda$cachedMapperMethod$0(MybatisMapperProxy.java:65) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_341]
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.cachedMapperMethod(MybatisMapperProxy.java:65) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:60) ~[mybatis-plus-core-3.2.0.jar:3.2.0]
    at com.sun.proxy.$Proxy81.deleteRelations(Unknown Source) ~[na:na]
    at com.atguigu.gulimall.product.service.impl.AttrServiceImpl.deleteRelation(AttrServiceImpl.java:320) ~[classes/:na]
    at com.atguigu.gulimall.product.service.impl.AttrServiceImpl$$FastClassBySpringCGLIB$$b5438598.invoke(<generated>) ~[classes/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at com.atguigu.gulimall.product.service.impl.AttrServiceImpl$$EnhancerBySpringCGLIB$$248fa62d.deleteRelation(<generated>) ~[classes/:na]
    at com.atguigu.gulimall.product.controller.AttrGroupController.deleteRelation(AttrGroupController.java:73) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_341]
 

报错原因:

mybatisp的application.properties信息配置信息错误

路径信息:resource包下

mapper/product/AttrAttrgroupRelationDao.xml

原本配置
mybatis-plus:
  mapper-locations: classpath*:mapper/*.xml,classpath*:mapper/**/*Mapper.xml
正确配置信息
mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
总结
  • mybatisplus不够熟练

  • mapper-locations: classpath的配置要看具体项目

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值