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

org.hibernate.NonUniqueObjectException: a different object with the same ide

2012-07-23 03:08 453 查看
org.hibernate.NonUniqueObjectException: a different object with the same ide

出现这种情况一般是一对多或者多对多级联方面,我的情况是两边同时级联 把关联表的留下,外界表的去除即可

    @OneToMany(mappedBy="admin")//,cascade=CascadeType.ALL)//,fetch=FetchType.EAGER)
    public Set<AdminRole> getAdminroles() {
        return adminroles;
    }

    @ManyToOne(cascade=CascadeType.ALL)//,fetch=FetchType.EAGER)
    @JoinColumn(name="adminId")
    public Admin getAdmin() {
        return admin;
    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  object ide
相关文章推荐