当前位置:网站首页>错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
2022-07-03 02:22:00 【梦远星帆】
网络有许多解决方法,我都没有解决,结果发现原来是文件xml.xml了,多了一个.xml
下面附上其他方法:
1.检查xml文件所在package名称是否和Mapper interface所在的包名
<mapper namespace="me.tspace.pm.dao.UserDao">
mapper的namespace写的不对!!!注意系修改。
2.UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此
3. UserDao的方法返回值是List<User>,而select元素没有正确配置ResultMap,或者只配置ResultType!
4. 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决
5.看下mapper的XML配置路径是否正确
关于Mybatis-plus报错Invalid bound statement (not found):com.xxx.xxx.xxxMapper.selectList

出现这个报错有可能是在写自己的UserMapper时继承了BaseMapper 但没有添加泛型。

只需要添加对应的泛型,
结果就不会报错了
如果全部检查了一遍,还发现没有问题,最好看下自己的配置文件,那时候很有可能是配置少了扫描mapper的东西:
在创建SqlSessionFactory的时候,加了以下配置:
sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*.xml"));
sqlSessionFactoryBean.setTypeAliasesPackage("com.test.maper");
而且注意sqlSessionFactoryBean.setTypeAliasesPackage参数不支持通配符*,如果有多个包可以通过","等分割
如果需要加载依赖传递过来的jar包中的mapper目录下的xml,classpath:mapper/*.xml 修改为classpath*:mapper/*.xml
边栏推荐
- COM和CN
- Oauth2.0 authentication, login and access "/oauth/token", how to get the value of request header authorization (basictoken)???
- Word word word
- [shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)
- easyExcel
- 5. File operation
- The use of Flink CDC mongodb and the implementation of Flink SQL parsing complex nested JSON data in monggo
- Packing and unpacking of JS
- Return a tree structure data
- Compréhension simple de SVG
猜你喜欢

elastic stack

Thread safe singleton mode

Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt

Create + register sub apps_ Define routes, global routes and sub routes

UDP receive queue and multiple initialization test
![[shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)](/img/41/2413af283e8f1db5d20ea845527175.gif)
[shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)

Stm32f407 ------- IIC communication protocol

Recommendation letter of "listing situation" -- courage is the most valuable

Tongda OA homepage portal workbench

stm32F407-------ADC
随机推荐
Restcloud ETL cross database data aggregation operation
GBase 8c系统表-pg_amop
Iptables layer 4 forwarding
GBase 8c系统表-pg_authid
Unrecognized SSL message, plaintext connection?
[tutorial] chrome turns off cross domain policies CORS and samesite, and brings cookies across domains
GBase 8c 函数/存储过程参数(一)
Memory pool (understand the process of new developing space from the perspective of kernel)
awk从入门到入土(1)awk初次会面
Kotlin middle process understanding and Practice (II)
Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
GBase 8c系统表-pg_amproc
GBase 8c系统表pg_database
[Yu Yue education] reference materials of chemical experiment safety knowledge of University of science and technology of China
[Yu Yue education] China Ocean University job search OMG reference
Socket编程
The Sandbox阐释对元宇宙平台的愿景
[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor
Awk from getting started to getting into the ground (3) the built-in functions printf and print of awk realize formatted printing
Tongda OA homepage portal workbench