当前位置:网站首页>Invalid bound statement (not found): com.exam.mapper.UserMapper.findbyid
Invalid bound statement (not found): com.exam.mapper.UserMapper.findbyid
2022-07-28 05:16:00 【jekyhu】
一、问题的出现:
调试代码的时候,把mapper.xml中的方法暂时的注释掉了,之后解除注释后,就出现了这个错误。具体报错如下:

二、解决方法:
1 . mapper.xml中的namespace和实际的mapper文件不一致。

如图中的 namespace,需要和实体类中的mapper一 一对应,否则就会报错。如下图一样,copy reference后放到namespace中就可以解决问题。

2 . mapper接口中的方法名和mapper.xml中的id标签不一致
如下图,select id=“xxxxx” ,xxxxx需要和mapper接口中的方法名一致。

此两处的 findbyid 是需要保持一样的。

3 . target目录下的mapper.xml文件内容与当前的不一致,或者没有构建进target目录。
target目录路径如下图:

(1) target目录下的 mapper.xml 文件内容与当前的不一致
target 文件下的 mapper.xml:

当前的 mapper.xml:

可以看到target中的被我当时注释掉的。把注释去掉就解决问题了。
(2)没有构建进target目录。
在IDEA终端执行下面的代码 :
mvn clean
mvn compile
边栏推荐
- Internal implementation principle of yymodel
- Performance test classification
- 【ARIXV2204】Neighborhood attention transformer
- Eccv2022 | 29 papers of Tencent Youtu were selected, including face security, image segmentation, target detection and other research directions
- Non functional test
- 11.< tag-动态规划和子序列, 子数组>lt.115. 不同的子序列 + lt. 583. 两个字符串的删除操作 dbc
- 类和对象【中】
- Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)
- jsonp 单点登录 权限检验
- ArrayList多线程安全解决办法
猜你喜欢

Simulink automatically generates STM32 code details

Eccv2022 | 29 papers of Tencent Youtu were selected, including face security, image segmentation, target detection and other research directions

How practical is the struct module? Learn a knowledge point immediately

Offline loading of wkwebview and problems encountered

MySQL(5)

Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address

类和对象【中】

为什么md5不可逆,却还可能被md5免费解密网站解密

MySQL 默认隔离级别是RR,为什么阿里等大厂会改成RC?

【ARXIV2203】Efficient Long-Range Attention Network for Image Super-resolution
随机推荐
Implementation of simple upload function in PHP development
Applet import project
About MySQL group_ What concat has to say
【SLAM】LVI-SAM解析——综述
Internal implementation principle of yymodel
Microservice failure mode and building elastic system
SMD component size metric English system corresponding description
【ARXIV2203】CMX: Cross-Modal Fusion for RGB-X Semantic Segmentation with Transformers
Making RPM packages with nfpm
Win10 machine learning environment construction pycharm, anaconda, pytorch
I've been in an outsourcing company for two years, and I feel like I'm going to die
C language: some self realization of string functions
Data security is gradually implemented, and we must pay close attention to the source of leakage
Keil Chinese garbled code solution
MySQL(5)
分享几种管理C程序中标志位的方法
C language classic 100 question exercise (1~21)
Anaconda common instructions
【CVPR2022 oral】Balanced Multimodal Learning via On-the-fly Gradient Modulation
The default isolation level of MySQL is RR. Why does Alibaba and other large manufacturers change to RC?