Invalid bound statement (not found): com.xyh.dao.ProductDao.updateByState
时间: 2023-09-29 09:03:37 浏览: 95
mybatisplus报Invalid bound statement (not found)错误的解决方法
5星 · 资源好评率100%
根据引用和引用的内容,Invalid bound statement (not found)错误通常是由于没有正确配置或使用MyBatis的mapper接口导致的。该错误可能是由于没有正确注解mapper接口或没有在启动类上加上@MapperScan注解导致的。
解决该问题的方法是,首先确认你的mapper接口是否正确注解了对应的mapper映射文件。在MyBatis中,mapper接口需要与mapper映射文件对应,否则就会报Invalid bound statement (not found)错误。确保在mapper接口上使用@Mapper注解或在启动类上使用@MapperScan注解,以扫描并正确加载mapper接口。
对于给出的例子,如果报错Invalid bound statement (not found): com.xyh.dao.ProductDao.updateByState,可能是由于ProductDao接口没有正确注解或者没有在启动类上加上@MapperScan注解导致的。
你可以尝试在ProductDao接口上加上@Mapper注解,并在启动类上加上@MapperScan注解,指定扫描com.xyh.dao包下的mapper接口。这样就能够正确加载并找到updateByState方法对应的mapper映射文件,解决Invalid bound statement (not found)错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Invalid bound statement (not found): com.example.demo.dao.UserDao.login](https://blog.csdn.net/weixin_41657954/article/details/121634575)[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%"]
- *3* [mybatisplus报Invalid bound statement (not found)错误的解决方法](https://download.csdn.net/download/weixin_38625442/12821082)[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 ]
阅读全文