網站首頁 編程語言 正文
1、先來看錯誤異常:
com.cfc.common.utils.TranFailException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'bussNo' in 'class java.lang.String'-->nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'bussNo' in 'class java.lang.String'
?? ?at com.cfc.common.utils.LogUtil$HanderExVo.invoke(LogUtil.java:412)
?? ?at com.cfc.common.utils.LogUtil.handerEx(LogUtil.java:319)
?? ?at com.cfc.common.utils.LogUtil.handerEx(LogUtil.java:280)
?? ?at com.cfc.common.utils.LogUtil.handerEx(LogUtil.java:257)
?? ?at com.cfc.common.utils.LogUtil.handerEx(LogUtil.java:245)
2、代碼實現:
對應的java中,是string類型:
?
然后mybatis的xml中,是map類型:
?
3、報錯的地方:
然后mybatis的xml中執行的代碼:
?
?
?如果不更改java代碼中String->Map類型,
我發現去掉if? test 標簽,也可以正常執行:
4、當然,正確的修改方式,還是要把傳參類型匹配對應上:
?
或者在mybatis中,修改對應的
parameterType="map"
為
parameterType="java.lang.String"
至于原理,要去看mybatis里面的反射源碼了:
?org.apache.ibatis.reflection.Reflector
?
這里也是由于不小心犯了一個低級錯誤:?
?
原文鏈接:https://blog.csdn.net/lejustdoit/article/details/120156769
相關推薦
- 2023-07-05 Spring aop+自定義注解實現接口返回數據過濾
- 2022-04-15 windows+vscode穿越跳板機調試遠程代碼的圖文教程_python
- 2022-11-15 python列表中常見的一些排序方法_python
- 2022-10-26 Python中打包和解包(*和**)的使用詳解_python
- 2022-11-13 Flutter入門學習Dart語言變量及基本使用概念_Dart
- 2023-05-16 關于mongodb版本升級問題_MongoDB
- 2024-03-22 springboot 中 Getmapping獲取參數的方式
- 2022-08-23 Pandas?Matplotlib保存圖形時坐標軸標簽太長導致顯示不全問題的解決_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支