当前位置:网站首页>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.
边栏推荐
- Project (5) - Small target detection tph-yolov5
- 接口测试关键技术
- 19. Support Vector Machines - Intuitive Understanding of Optimization Objectives and Large Spacing
- YOLOV5学习笔记(三)——网络模块详解
- Thesis framework of the opening report
- Classic linked list OJ strong training problem - fast and slow double pointer efficient solution
- JS function this context runtime syntax parentheses array IIFE timer delay self.backup context call apply
- Ambiguous method call.both
- 5. SAP ABAP OData 服务如何支持 $filter (过滤)操作
- Moxa NPort 设备缺陷可能使关键基础设施遭受破坏性攻击
猜你喜欢
随机推荐
【Android】Room —— SQLite的替代品
【异常】The field file exceeds its maximum permitted size of 1048576 bytes.
Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)
10、Redis实现点赞(Set)和获取总点赞数
IDEA 注释报红解决
刚出道“一战成名”,安全、舒适一个不落
What is distributed and clustered?What is the difference?
php 网站的多语言设置(IP地址区分国内国外)
你们程序员为什么不靠自己的项目谋生?而必须为其他人打工?
Why is String immutable?
print task sorting js od huawei
YOLOV5学习笔记(三)——网络模块详解
C primer plus学习笔记 —— 8、结构体
下载jar包的好地方
15. Website Statistics
Installation of mysql5.7.37 under CentOS7 [perfect solution]
Is interprofessional examination difficult?Low success rate of "going ashore"?Please accept this practical guide!
11. Redis implements follow, unfollow, and follow and follower lists
QML的使用
公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部