当前位置:网站首页>Several common errors when using MP
Several common errors when using MP
2022-07-31 03:02:00 【qq_45860901】
One, the automatic insertion of the date reports null, but the MetaObjectHandler has been configured
Description:
Solution:
as followsThe metaobject has been configured or an error is reported.
The actual cause of the problem is the corresponding attribute of the entity classThe type is not LocalDateTime but Date, which should be changed to LocalDateTime.
Change Date to LocalDateTime
Second, the primary key id has no error and no default value
Description:
org.springframework.dao.DataIntegrityViolationException:
Error updating database. Cause: java.sql.SQLException: Field 'subject_parent_id' doesn't have a default value
Resolved;
The id annotation should be set to auto-increment in the database
Third, Parameter ‘MP_OPTLOCK_VERSION_ORIGINAL’ not found.
When the updateById method is used and the updated field contains the version field, the MP optimistic lock will be used by default.
There will be one more version condition in sql.
Solution:
Type 1: UpdatedDo not include the version field in the field.
Second: You can use the update method of Mapper.
边栏推荐
- C primer plus学习笔记 —— 8、结构体
- C#远程调试
- 【Android】Room —— SQLite的替代品
- Discussion on Service Commitment of Class Objects under Multithreading
- Addition and Subtraction of Scores in LeetCode Medium Questions
- 知识蒸馏7:知识蒸馏代码详解
- 跨专业考研难度大?“上岸”成功率低?这份实用攻略请收下!
- Difference between CMOS and TTL?
- Multilingual settings of php website (IP address distinguishes domestic and foreign)
- 【CV项目调试】CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT问题
猜你喜欢

IDEA 注释报红解决

Pythagorean tuple od js

跨专业考研难度大?“上岸”成功率低?这份实用攻略请收下!

The whole process scheduling, MySQL and Sqoop

Why is String immutable?

Ambiguous method call.both
![Installation of mysql5.7.37 under CentOS7 [perfect solution]](/img/ef/a89d8bfd09377dc30034bad99dfd07.png)
Installation of mysql5.7.37 under CentOS7 [perfect solution]

Moxa NPort device flaw could expose critical infrastructure to devastating attack

MultipartFile文件上传

mycat的主从关系 垂直分库 水平分表 以及mycat分片联表查询的配置详解(mysql5.7系列)
随机推荐
JS function this context runtime syntax parentheses array IIFE timer delay self.backup context call apply
CloudCompare&PCL 计算两个点云之间的重叠度
12 磁盘相关命令
LeetCode中等题之分数加减运算
Android's webview cache related knowledge collection
分布式与集群是什么 ? 区别是什么?
[C language foundation] Solve C language error: expected ';', ',' or ')' before '&' token
关于 mysql8.0数据库中主键位id,使用replace插入id为0时,实际id插入后自增导致数据重复插入 的解决方法
【编译原理】词法分析程序设计原理与实现
加密公司向盗窃的黑客提供报价:保留一点,把剩下的归还
10. Redis implements likes (Set) and obtains the total number of likes
SonarQube的BUG定义
解析小结—自用
The modification is not properly placed in the sandbox, causing Apple compatibility issues
CentOS7下mysql5.7.37的安装【完美方案】
return in try-catch
YOLOV5 study notes (3) - detailed explanation of network module
YOLOV5学习笔记(三)——网络模块详解
Crypto Firms Offer Offer To Theft Hackers: Keep A Little, Give The Rest
Classic linked list OJ strong training problem - fast and slow double pointer efficient solution