Invalid bound statement (not found): com.example.mapper.StudentMapper.findByPage
时间: 2024-05-29 19:07:39 浏览: 23
Invalid bound statement (not found): com.example.mapper.StudentMapper.findByPage通常意味着在MyBatis的Mapper XML文件中找不到对应的SQL语句。请检查StudentMapper.xml文件,确保已经正确地定义了findByPage语句。此外,还需要确保在对应的Java接口文件StudentMapper.java中有对应的方法声明。如果这些都没有问题,可能是MyBatis配置或者映射文件位置的问题,请检查是否正确配置了MyBatis和Mapper XML文件的路径。
相关问题
Invalid bound statement (not found): com.example.demo.mapper.StudentMapper.selectPage
在解决这个问题时,我们需要参考多个引用内容。首先,我们可以看到引用提到了BaseMapper使用了范型。这意味着我们的UserMapper在继承BaseMapper时也需要写上对应的范型。接下来,引用给出了解决方案之一,即创建Mapper.xml文件时需要注意一些细节。最后,引用给出了另一个解决方案,即在pom.xml文件中添加一些配置来指定mapper.xml文件的位置。
所以,对于你提到的错误信息"Invalid bound statement (not found): com.example.demo.mapper.StudentMapper.selectPage",可能是由于在StudentMapper中的selectPage方法没有正确映射到对应的mapper.xml文件中引起的。你可以检查一下是否在StudentMapper.xml文件中正确配置了selectPage方法。同时,也要确保你的UserMapper正确继承了BaseMapper,并且写上了对应的范型。
另外,你也可以尝试参考引用和中的解决方案来解决这个问题。通过注意创建Mapper.xml文件的细节和在pom.xml文件中添加相关配置,可能会有助于解决该错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [mybatis-plus出错:Invalid bound statement (not found): com.kuang.mapper.UserMapper.selectList](https://blog.csdn.net/fuqiang133/article/details/126943324)[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~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [ idea Mapper .XML 文件没有构建成功:Invalid bound statement (not found): com.example.xx项目.mapper](https://blog.csdn.net/weixin_47068543/article/details/124921824)[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~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
Invalid bound statement (not found): com.example.webshop.mapper.GoodsCoreApplyMapper.selectById
Invalid bound statement (not found): com.example.webshop.mapper.GoodsCoreApplyMapper.selectById 是一个错误的绑定语句,它表示在 com.example.webshop.mapper.GoodsCoreApplyMapper 接口中找不到名为 selectById 的语句。这个错误通常发生在使用 MyBatis 进行数据库操作时,当你在映射文件中引用了一个不存在的语句时会出现这个错误。
要解决这个问题,你需要检查以下几个方面:
1. 确保 com.example.webshop.mapper.GoodsCoreApplyMapper 接口中存在名为 selectById 的方法,并且方法的参数和返回值与映射文件中的语句定义一致。
2. 检查映射文件(通常是 XML 文件)中是否存在名为 selectById 的语句,并且语句的 id 属性与接口中的方法名一致。
3. 确保映射文件所在的路径在 MyBatis 的配置文件中正确配置,以便 MyBatis 能够找到映射文件。
如果以上步骤都没有问题,那么可能是因为编译或部署过程中出现了错误,你可以尝试重新编译和部署项目。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)