当前位置:网站首页>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.
边栏推荐
- execsnoop 工具
- MultipartFile file upload
- Go 项目实战-获取多级分类下的全部商品
- TCP详解(二)
- CorelDRAW2022精简亚太新增功能详细介绍
- Project (5) - Small target detection tph-yolov5
- SQL injection Less54 (limited number of SQL injection + union injection)
- CorelDRAW2022 streamlined Asia Pacific new features in detail
- IDEA 注释报红解决
- 华为分布式存储FusionStorage知识点总结【面试篇】
猜你喜欢
Difference between CMOS and TTL?
6、显示评论和回复
What is distributed and clustered?What is the difference?
MultipartFile file upload
Intel's software and hardware optimization empowers Neusoft to accelerate the arrival of the era of smart medical care
What is a distributed lock?Three ways of implementing distributed lock
接口测试关键技术
VS QT——ui不显示新添加成员(控件)||代码无提示
8、统一处理异常(控制器通知@ControllerAdvice全局配置类、@ExceptionHandler统一处理异常)
JS function this context runtime syntax parentheses array IIFE timer delay self.backup context call apply
随机推荐
SQL注入 Less46(order by后的注入+rand()布尔盲注)
选好冒烟测试用例,为进入QA的制品包把好第一道关
Discourse 自定义头部链接(Custom Header Links)
JetPack组件Databinding
SQL注入 Less54(限制次数的SQL注入+union注入)
Number 16, top posts
16、热帖排行
Chapter 9 SVM Practice
CorelDRAW2022精简亚太新增功能详细介绍
Moxa NPort 设备缺陷可能使关键基础设施遭受破坏性攻击
【编译原理】递归下降语法分析设计原理与实现
【C语言】进制转换一般方法
Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)
图解lower_bound&upper_bound
工程(五)——小目标检测tph-yolov5
接口测试关键技术
Word/Excel fixed table size, when filling in the content, the table does not change with the cell content
华为分布式存储FusionStorage知识点总结【面试篇】
4、敏感词过滤(前缀树)
Detailed explanation of TCP (3)