有两张表,表1与表2有 ,其中表1 里做了关联<one -to-one> 或 < many-to-one unique=“true” >(特殊的多对一映射,实际就是一对一) 来关联表2,当hibernate查找的时候,表2里的数据与表1没有匹配,这样就会报 No row with the given identifier exists(数据有问题)
Hibernate 中出现 No row with the given identifier exists 的原因及解决方案
原因分析:有两张表,表1与表2有 ,其中表1 里做了关联<one -to-one> 或 < many-to-one unique=“true” >(特殊的多对一映射,实际就是一对一) 来关联表2,当hibernate查找的时候,表2里的数据与表1没有匹配,这样就会报 No row with the given identifier exists(数据有问题)解决方案:1、将原来两张表由双向关联改为单向关联2、将错误的数据改正确示例:如下是我遇到的问题.