HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.wjs.mapper.TbitemMapper_ext.selectByRandom

如果出现上述错误:解决方案:

扫描的动态代理开发模式下,这接口和mapper文件名称必须一致!!!

若想添加新的sql语句(不用上图使用的方法),则创建新的接口,新的mapper文件。

附mybatis笔记:

Mybatis总结

Mapper的动态代理开发技术,创建的接口由mybatis实例化。

mapper-spring的整合包里,有一个

MapperFactoryBean.class文件。这个工厂(工厂交给spring创建)还是根据接口的形式生产实现类类似于:

 18.4.11Mybatis:报Invalid bound statement (not found):

 18.4.11Mybatis:报Invalid bound statement (not found):

使用扫描方式的动态代理开发,不用配置mapperFactoryBean,麻烦,换类

 18.4.11Mybatis:报Invalid bound statement (not found):

解决****添加自定义语句方法。

18.4.11Mybatis:报Invalid bound statement (not found):

相关文章:

  • 2021-07-22
  • 2021-06-26
  • 2021-07-08
  • 2021-11-17
  • 2022-02-10
猜你喜欢
  • 2021-07-31
  • 2022-01-02
  • 2021-05-26
  • 2021-05-02
相关资源
相似解决方案