Hibernate:More than one row with the given identifier was found解决办法


今天写一个Action 通过 HQL 查询一个表 出现异常 “More than one row with the given identifier was found”

问题原因: 数据库出现数据异常 存在多条主键不唯一的数据

问题解决: 找到数据库表 删除全部数据 然后重新导入 问题没了


我的情况:写请假表单的时候,form表单被提交了两次,导致我的@OneToOne 出错,因为里面有
两条数据了,导致主键不唯一!

猜你喜欢

转载自317722960.iteye.com/blog/1995734