当前位置:网站首页>错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
2022-08-05 06:15:00 【Gentle elder brother `】
This is the full text of the problem I'm having:
Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'providerName' of 'class com.smbms.pojo.Bill' with value 'Provider(id=null, proCode=null, proName=ShenzhenTaixiang Rice Co., Ltd., proDesc=null, proContact=null, proPhone=null, proAddress=null, proFax=null, createdBy=null, creationDate=null, modifyBy=null, modifyDate=null)' Cause: java.lang.IllegalArgumentException: argument type mismatch
In this case, he can still find out some of the results, but he will still report an error. The following picture is the console display of my error

Solution
This problem bothered me for an afternoon and was solved. In fact, the type of the resultMap tag under the complex type collection of a collection was written incorrectly, because I put myproviderName is defined as String type, but I wrote it as com.smbms.pojo.Provider in Type, which caused my program to have this problem all the time, even though I debugged a lot of other places to no avail.
This is my previous error code:
This is my modified code:
As you can see, change the type of the resultMap tag below to java.lang.String, and the operation is successful.
The following picture is the result after successful operation, you can see that the result found at this time is complete

But what makes me confused is that I changed javaType="com.smbms.pojo.Provider" to javaType=" java.lang.String" in the code below and stillThere is no mistake, I hope that friends who understand can leave a message in the comment area.
Supplementary knowledge points
collection
Collection of complex types, one-to-many
Inner nesting, mapping a nested result set to a list
Property property: The property of the entity object that maps the database column
ofType: full Java class name or alias (types included in the collection)
resultMap: reference to external resultMap
Child element id
result property: property of the entity object that maps the database column
边栏推荐
- Mongodb query analyzer parsing
- IJCAI 2022|Boundary-Guided Camouflage Object Detection Model BGNet
- Hugo builds a personal blog
- [Day8] Commands involved in using LVM to expand
- Apache配置反向代理
- VLAN详解及实验
- spark source code - task submission process - 2-YarnClusterApplication
- Three modes of vim
- spark source code - task submission process - 3-ApplicationMaster
- The problem come from line screening process
猜你喜欢

入门文档11 自动添加版本号

通过单总线调用ds18b20的问题

硬盘分区和永久挂载

Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
![[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data](/img/29/5b44c016bd11f0c0a9110cf513f4e1.png)
[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data

dsf5.0 弹框点确定没有返回值的问题

解决这三大问题,运维效率将超90%的医院

Hugo builds a personal blog

NIO工作方式浅析

IP packet format (ICMP protocol and ARP protocol)
随机推荐
正则表达式小实例--去掉字符串中间和两边的空格
TCP/IP four-layer model
I217-V在openwrt软路由下大流量断网问题
智能运维会取代人工运维吗?
Mongodb query analyzer parsing
入门文档05 使用cb()指示当前任务已完成
dsf5.0 弹框点确定没有返回值的问题
lvm逻辑卷及磁盘配额
Transport layer protocol (TCP 3-way handshake)
ACLs and NATs
The spark operator - repartition operator
Dsf5.0 bounced points determine not return a value
增长:IT运维发展趋势报告
入职前,没想到他们玩的这么花
VRRP principle and command
spark operator-textFile operator
[Day8] (Super detailed steps) Use LVM to expand capacity
spark operator-parallelize operator
【Day8】使用LVM扩容所涉及的命令
spark算子-wholeTextFiles算子