Hibernate 常见异常

来源:互联网 发布:java编写软件手机软件 编辑:程序博客网 时间:2024/06/16 13:01

1、org.hibernate.HibernateException: More than one row with the given identifie

原因:举个例子,A是省市,B是县市,B对应A是OneToOne关系。出现这个异常是因为A中的有两笔一样的data(数据),这个时候B对应A出现了迷茫,不知道应该对应A中呢两条data(数据)中的哪一个。