Invalid bound statement (not fou
2020-11-06 本文已影响0人
Skittle丶
周一的时候,和横向合作的公司确定了使用了Oracle数据库。其实我之前开发没有用过Oracle,5天时间从安装到整合到mybatis,只能说还是我太菜了,springboot也没学好,mybatis之前搭SSM的时候写过一个DEMO也都忘了。这几天主要的一个问题是一运行就提示我
Invalid bound statement (not found): com.xjtu.mapper.PartMapper.findAll
网上的提示其实很多,一般就是:

映射文件mapper标签中的namespace必须是接口的全类路劲名称(dao接口名必须跟映射文件名完全一样,字母大小也要一致)
相信大家一般都能解决这个问题吧,不至于写错

映射文件中的ID必须与接口中方法名称一致。这个一般也不至于写错。其实有时候resultType写成resultMap会报Result Maps collection does not contain value for java.util.List的错误。具体这两个有什么区别,我还是再继续学习一下吧,也恳请大家指点
但是如果mapper文件写的没问题,但是其实application文件中的配置问题同样会导致Invalid bound statement (not found)的问题。

这一类的常见问题可能也就是以上这些了,多看看配置文件,debug就顺利啦!