org.springframework.dao.DuplicateKeyException:在java中是什么意思?

如题所述

org.springframework.dao.DuplicateKeyException: a different object with the same identifier value was already associated with the session: [com.sinosoft.claim.schema.model.PrpLlossInfo#REG13552269089070]; nested exception is org.hibernate.NonUniqueObjectException: a different object with 这个问题的话原因是在调用持久层类的进行保存域更新的时候,主键或唯一性约束冲突了。
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2018-03-01
看看这个类的文档就明白了,是说主键或唯一键约束失败时会抛出的异常:

Exception thrown when an attempt to insert or update data results in violation of an primary key or unique constraint. Note that this is not necessarily a purely relational concept; unique primary keys are required by most database types.本回答被提问者和网友采纳
第2个回答  2015-10-26
是由于主键重复插入,导致的异常。
第3个回答  2018-02-28
直觉告诉我,这是 主键重复的错误,你看下是不是 插入数据库的记录 主键重复了
第4个回答  2015-11-17
字面意思是主键重复
相似回答