您的位置:首页 > 移动开发 > Objective-C

.NonUniqueObjectException: a different object with the same identifier等的解决

2016-08-12 00:36 477 查看
这几天写hibernate+struts2+easyui+Oracle小项目时遇到的异常。

org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [entity.TbBooks#1]


看英语,就表示主键重复。检查。oracle数据库自增长的设置,发现一切都ok。依旧还是报错。



将开始的数字稍微改大一点点。

另外,写jQuery验证的时候,记得方法要被function包住,如下

$(function(){
$("#book").submit(function(){
if(check()==false){
return false;
}else{
return true;
}

});




easy ui中多个表查询时字段的设置:

field : 'tbSort',
title : '图书分类',
width : 100,
align : 'center',
formatter : function(value, row, index) {
if (row.tbSort) {
return row.tbSort.name;
} else {
return value;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hibernate struts
相关文章推荐