当前位置:网站首页>How to package the parsed Excel data into objects and write this object set into the database?
How to package the parsed Excel data into objects and write this object set into the database?
2022-07-07 04:46:00 【CSDN Q & A】
The phenomenon and background of the problem
Today, I am learning parsing Excel file , Write the parsed data into the database , But the parsed data is a set , I don't know how to write to the database , Always report mistakes
Problem related code , Do not paste screenshots
mapper Code

mybatis Of xml file

service layer


This is a controller layer , Will be resolved list The objects in the collection are written to the database

This is the analysis Excel Get the object

This is the content of the error report , I didn't know how to do it for hours , Write only list The first one in the collection , The latter cannot be written into the database
org.apache.ibatis.binding.BindingException: Mapper method 'com.xjh.exceljiexi.mapper.UserExcelModelMapper.insert' has an unsupported return type: class com.xjh.exceljiexi.domain.UserExcelModel
at org.apache.ibatis.binding.MapperMethod.rowCountResult(MapperMethod.java:118) ~[mybatis-3.5.9.jar:3.5.9]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) ~[mybatis-3.5.9.jar:3.5.9]
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145) ~[mybatis-3.5.9.jar:3.5.9]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) ~[mybatis-3.5.9.jar:3.5.9]
at com.sun.proxy.$Proxy59.insert(Unknown Source) ~[na:na]
at com.xjh.exceljiexi.service.impl.UserExcelModelImpl.addUser(UserExcelModelImpl.java:24) ~[classes/:na]
at com.xjh.exceljiexi.controller.FileController.readExcel(FileController.java:53) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_301]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_301]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_301]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_301]
This error has been stuck for threeorfour hours , How to modify the code to complete this function ? Ask for an answer
Take the answer :
Have a look at , I didn't find anything wrong , But I have a little suggestion , You can set breakpoints when inserting data into the database , Check the currently inserted domain Whether the object is wrong , If it's normal , That means all your previous codes are correct , Only myBatis There are some problems here . Then continue to look slowly
边栏推荐
- Terms used in the Web3 community
- EasyCVR集群版本添加RTSP设备提示服务器ID错误,该如何解决?
- Zhou Yajin, a top safety scholar of Zhejiang University, is a curiosity driven activist
- 深耕开发者生态,加速AI产业创新发展 英特尔携众多合作伙伴共聚
- MySQL split method usage
- A detailed explanation of head pose estimation [collect good articles]
- 架构实战训练营|课后作业|模块 6
- 图灵诞辰110周年,智能机器预言成真了吗?
- R语言主成分pca、因子分析、聚类对地区经济研究分析重庆市经济指标
- How to conduct website testing of software testing? Test strategy let's go!
猜你喜欢

九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」

DFS和BFS概念及实践+acwing 842 排列数字(dfs) +acwing 844. 走迷宫(bfs)

Oracle -- 视图与序列

Win11玩绝地求生(PUBG)崩溃怎么办?Win11玩绝地求生崩溃解决方法

EasyCVR平台接入RTMP协议,接口调用提示获取录像错误该如何解决?

What if the win11 screenshot key cannot be used? Solution to the failure of win11 screenshot key

【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ

Break the memory wall with CPU scheme? Learn from PayPal to expand the capacity of aoteng, and the volume of missed fraud transactions can be reduced to 1/30

Easycvr cannot be played using webrtc. How to solve it?

Common methods of list and map
随机推荐
[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp
JS form get form & get form elements
MySQL forgot how to change the password
Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market
Depth first traversal template principle of tree and graph
ESG Global Leaders Summit | Intel Wang Rui: coping with global climate challenges with the power of science and technology
[team learning] [34 sessions] Alibaba cloud Tianchi online programming training camp
How to conduct website testing of software testing? Test strategy let's go!
深耕开发者生态,加速AI产业创新发展 英特尔携众多合作伙伴共聚
namespace基础介绍
程序员上班摸鱼,这么玩才高端!
VM virtual machine operating system not found and NTLDR is missing
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
EasyCVR无法使用WebRTC进行播放,该如何解决?
【数模】Matlab allcycles()函数的源代码(2021a之前版本没有)
Canteen user dish relationship system (C language course design)
未婚夫捐5亿美元给女PI,让她不用申请项目,招150位科学家,安心做科研!
What work items do programmers hate most in their daily work?
A detailed explanation of head pose estimation [collect good articles]