ORA-00001: 违反唯一约束条件 --解决方法

1、错误
Caused by: java.sql.BatchUpdateException:ORA-00001: 违反唯一约束条件 (SOLEX.SYS_C0012537)
2、分析
①通过SYS_C0012537找到对应的表
select a.constraint_name,a.constraint_type,b.column_name,b.table_name
from user_constraints a inner join user_cons_columns b on a.table_name=b.table_name
where a.constraint_name=‘SYS_C0012537’
②同hbm.xml文件找到主键的自增序列名称

SEQ_FEEPAY_COST_D

③到数据库序列sequences查找该序列名称:SEQ_FEEPAY_COST_D,然后修改下一个ID的值
ORA-00001: 违反唯一约束条件 --解决方法_第1张图片

你可能感兴趣的:(数据库)