当前位置:网站首页>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.
边栏推荐
- 注解用法含义
- What is distributed and clustered?What is the difference?
- SonarQube的BUG定义
- The simulation application of common mode inductance is here, full of dry goods for everyone
- 15. Website Statistics
- 10、Redis实现点赞(Set)和获取总点赞数
- 7. List of private messages
- MultipartFile文件上传
- 公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部
- [Godot][GDScript] 二维洞穴地图随机生成
猜你喜欢
Chapter 9 SVM Practice
Mysql 45讲学习笔记(二十四)MYSQL主从一致
10. Redis implements likes (Set) and obtains the total number of likes
【C语言】进制转换一般方法
12 磁盘相关命令
STM32问题合集
JS 函数 this上下文 运行时点语法 圆括号 数组 IIFE 定时器 延时器 self.备份上下文 call apply
Pythagorean tuple od js
Intel's software and hardware optimization empowers Neusoft to accelerate the arrival of the era of smart medical care
刚出道“一战成名”,安全、舒适一个不落
随机推荐
Clustering index, and what is the difference between a clustering index
Android's webview cache related knowledge collection
10. Redis implements likes (Set) and obtains the total number of likes
选好冒烟测试用例,为进入QA的制品包把好第一道关
【C语言】三子棋(经典解法+一览图)
SQL注入 Less54(限制次数的SQL注入+union注入)
7. List of private messages
SQL injection Less54 (limited number of SQL injection + union injection)
[Godot][GDScript] 二维洞穴地图随机生成
C primer plus学习笔记 —— 8、结构体
Modbus on AT32 MCU
JS function this context runtime syntax parentheses array IIFE timer delay self.backup context call apply
12 Disk related commands
Mathematics to solve the problem - circular linked list
Chapter 9 SVM实践
2022牛客多校联赛第四场 题解
局域网电脑硬件信息收集工具
Pythagorean tuple od js
15. Website Statistics
学习DAVID数据库(1)