Closed xinsibo closed 4 years ago
使用@TableId注解标记双主键,调用baseMapper 的 updateById(Entity entity)无效,会执行update table_name set 主键1=? where 主键2=?,导致唯一性约束错误。
)**
; ORA-00001: 违反唯一约束条件 (POSP.SYS_C009385) ; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (POSP.SYS_C009385)
不支持,下版本多个注解将直接启动报错
当前使用版本(3.3.1)
该问题是怎么引起的?**(
使用@TableId注解标记双主键,调用baseMapper 的 updateById(Entity entity)无效,会执行update table_name set 主键1=? where 主键2=?,导致唯一性约束错误。
)**
重现步骤
使用@TableId注解标记双主键,调用baseMapper 的 updateById(Entity entity)无效,会执行update table_name set 主键1=? where 主键2=?,导致唯一性约束错误。
报错信息
The error may exist in com/bqd/merchant/api/mapper/SysRoleMapper.java (best guess)
The error may involve com.bqd.merchant.api.mapper.SysRoleMapper.updateById-Inline
The error occurred while setting parameters
SQL: UPDATE CMP_SYS_ROLE SET name=?, cmp_id=? WHERE ID=?
Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (POSP.SYS_C009385)
; ORA-00001: 违反唯一约束条件 (POSP.SYS_C009385) ; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (POSP.SYS_C009385)