首页 > 其他 > 详细

主键冲突异常 DuplicateKeyException

时间:2016-08-06 08:34:16      阅读:5970      评论:0      收藏:0      [点我收藏+]

 

org.springframework.dao.DuplicateKeyException


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.

Author:
Thomas Risberg

代码片段

import org.springframework.dao.DuplicateKeyException;

try{
    someMapper.insert(someBean);
    //TODO something
}catch(DuplicateKeyException e){
    //TODO something else
}

 

主键冲突异常 DuplicateKeyException

原文:http://www.cnblogs.com/zno2/p/4538614.html

(2)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!