org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.example.mapper.StudentMapper.deleteById
时间: 2023-10-17 11:34:14 浏览: 167
JAVA之ibatis2.3.X.ppt
引用:错误信息"nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cloud.lowcode.mapper.UserMapper.queryByParam"表示无法找到com.cloud.lowcode.mapper.UserMapper类的queryByParam方法的绑定语句。
根据中的翻译,这个错误信息的中文意思是"嵌套异常是org.apache.ibatis.binding.BindingException:无法绑定当前com.cloud.lowcode.mapper包下的UserMapper类的queryByParam方法"。
首先,我们需要检查启动类的配置。然后,我们可以查看对应的UserMapper.java类,如所示:
```java
package com.cloud.lowcode.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.cloud.lowcode.entity.po.User;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 用户实体类
*/
@Mapper
public interface UserMapper extends BaseMapper<User> {
List<User> queryByParam(String username);
}
```
以上是UserMapper.java类的源代码。根据代码,我们可以看到UserMapper接口继承了BaseMapper接口,并定义了queryByParam方法,该方法接受一个String类型的参数username,并返回一个List<User>类型的结果。
根据你提供的错误信息"org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.example.mapper.StudentMapper.deleteById",我注意到这个错误信息中的类路径是org.example.mapper.StudentMapper,而不是com.cloud.lowcode.mapper.UserMapper。因此,可能是配置文件或代码中使用了错误的类路径导致无法找到绑定语句。请检查你的配置文件或代码中是否正确引用了com.cloud.lowcode.mapper.UserMapper类的相关方法。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):xxx问题](https://blog.csdn.net/lvoelife/article/details/128017529)[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: 100%"]
[ .reference_list ]
阅读全文