Invalid bound statement (not found): org.example.mapper.StudentMapper.deleteById
时间: 2023-10-19 12:31:05 浏览: 160
出现 "Invalid bound statement (not found)" 错误通常是因为mapper接口和mapper.xml文件没有正确映射起来。常见的错误包括:
- 检查mapper.xml中的namespace和实际的mapper文件是否一致。确保两者的命名空间一致,否则会导致找不到对应的mapper方法。
解决方案:检查mapper.xml文件的namespace是否与对应的mapper接口一致,并确保没有拼写错误或者其他错误。
另外,特别注意一些细节问题。比如,如果项目使用了mybatisplus,调用mapper方法查询数据库时报错"Invalid bound statement (not found)",这可能是由于资源文件的位置问题导致的。确保resources目录中的xxxMapper.xml文件的位置要和mapper接口的位置对应,文件夹的命名要逐级对应,不要与包的命名方式相混淆。
总结一下解决这个问题的步骤:
- 检查mapper.xml中的namespace是否与对应的mapper接口一致。
- 确保xxxMapper.xml文件的位置与mapper接口的位置对应,文件夹的命名要逐级对应。123
引用[.reference_title]
- 1 3 关于Invalid bound statement (not found)出现原因和解决方法[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2
allinsert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - 2 mybatisplus报Invalid bound statement (not found)错误的解决方法[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2
allinsert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
相关推荐


















