当前位置:网站首页>MP使用时的几个常见报错
MP使用时的几个常见报错
2022-07-31 02:59:00 【qq_45860901】
一,日期的自动插入报null,但是MetaObjectHandler已经配置
描述:
解决:
如下metaobject已经配置还是报错。
实际的问题原因是实体类的对应属性的类型不是LocalDateTime 而是Date,应改为LocalDateTime。
将Date改为LocalDateTime
二,主键id没有报错没有default value
描述:
org.springframework.dao.DataIntegrityViolationException:
Error updating database. Cause: java.sql.SQLException: Field ‘subject_parent_id’ doesn’t have a default value
解决;
数据库中要对id注解设置自增
三,Parameter ‘MP_OPTLOCK_VERSION_ORIGINAL’ not found.
当使用updateById 方法, 且更新的字段中含有version字段时,会默认使用MP的乐观锁。
sql中会多一个version条件。
解决:
第一种:更新的字段中不要包含version字段。
第二种:可使用Mapper 的update 方法。
边栏推荐
- PMP微信群日常习题
- CefSharp入门-winform
- The simulation application of common mode inductance is here, full of dry goods for everyone
- 测试中的误报和漏报同样的值得反复修正
- 5. SAP ABAP OData 服务如何支持 $filter (过滤)操作
- CorelDRAW2022 streamlined Asia Pacific new features in detail
- 自动化办公案例:如何自动生成期数据?
- 遗留系统的自动化策略
- Installation, start and stop of redis7 under Linux
- Multilingual settings of php website (IP address distinguishes domestic and foreign)
猜你喜欢
随机推荐
JS 函数 this上下文 运行时点语法 圆括号 数组 IIFE 定时器 延时器 self.备份上下文 call apply
跨专业考研难度大?“上岸”成功率低?这份实用攻略请收下!
【C语言基础】解决C语言error: expected ‘;‘, ‘,‘ or ‘)‘ before ‘&‘ token
SonarQube的BUG定义
Moxa NPort 设备缺陷可能使关键基础设施遭受破坏性攻击
Classic linked list OJ strong training problem - fast and slow double pointer efficient solution
f.grid_sample
19.支持向量机-优化目标和大间距直观理解
SQL注入 Less46(order by后的注入+rand()布尔盲注)
Modbus on AT32 MCU
10. Redis implements likes (Set) and obtains the total number of likes
try-catch中含return
Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)
Clustering index, and what is the difference between a clustering index
10 权限介绍
Graphical lower_bound & upper_bound
6、显示评论和回复
Draw Your Cards
【编译原理】词法分析程序设计原理与实现
加密公司向盗窃的黑客提供报价:保留一点,把剩下的归还









