1、org.hibernate.HibernateException: More than one row with the given identifie
原因:举个例子,A是省市,B是县市,B对应A是OneToOne关系。出现这个异常是因为A中的有两笔一样的data(数据),这个时候B对应A出现了迷茫,不知道应该对应A中呢两条data(数据)中的哪一个。
本文探讨了在使用Hibernate框架时遇到的一个常见问题——当尝试保存具有重复唯一标识符的数据时引发的MoreThanOneRowWithTheGivenIdentifier异常。通过一个具体的例子解释了问题的根源,并提出了解决方案。
1、org.hibernate.HibernateException: More than one row with the given identifie
原因:举个例子,A是省市,B是县市,B对应A是OneToOne关系。出现这个异常是因为A中的有两笔一样的data(数据),这个时候B对应A出现了迷茫,不知道应该对应A中呢两条data(数据)中的哪一个。
6433
1060

被折叠的 条评论
为什么被折叠?