当前位置:网站首页>主键策略问题
主键策略问题
2022-07-02 07:21:00 【java能飞翔】
在使用MP进行数据库操作时,出现了下列错误,
com.alibaba.excel.exception.ExcelAnalysisException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.ym.edu.entity.Subject' with value '1540878683122229249' Cause: java.lang.IllegalArgumentException: argument type mismatch
经过检查,发现是主键策略问题,ID_WORKER这个主键策略获得的是long类型,而数据库是字符串类型
@ApiModelProperty(value = "课程类别ID")
@TableId(value = "id", type = IdType.ID_WORKER)
private String id;
因此主键策略应该改为ID_WORKER_STR。
边栏推荐
- 12.进程同步与信号量
- PCL point cloud to depth image
- PCL 从一个点云中提取一个子集
- Easyexcel, a concise, fast and memory saving excel processing tool
- 首份中国企业敏捷实践白皮书发布| 附完整下载
- MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)
- 01 install virtual machine
- PCL之K-d树与八叉树
- MySQL lethal serial question 3 -- are you familiar with MySQL locks?
- static 函数中的静态变量
猜你喜欢
随机推荐
(5) Gear control setting of APA scene construction
JSP webshell免殺——JSP的基礎
[SUCTF2018]followme
正则及常用公式
【ARK UI】HarmonyOS ETS的启动页的实现
Hdu1234 door opener and door closer (water question)
Win11 arm系统配置.net core环境变量
MySQL lethal serial question 3 -- are you familiar with MySQL locks?
华为游戏初始化init失败,返回错误码907135000
学习open62541 --- [66] UA_String的生成方法
What are the popular frameworks for swoole in 2022?
JS settimeout() and interview questions
HDU1236 排名(结构体排序)
Pywin32打开指定窗口
Read H264 parameters from mediarecord recording
Database dictionary Navicat automatic generation version
Common methods of JS array
12.进程同步与信号量
4.随机变量
【AGC】构建服务3-认证服务示例









