1. 程式人生 > >No row with the given identifier exists

No row with the given identifier exists

one table 解決 any 查找 unique 關聯 java 裏的

Hibernate中No row with the given identifier exists問題的原因及解決

產生此問題的原因:

有兩張表,table1和table2.產生此問題的原因就是table1裏做了關聯<one-to-one>或者<many-to-one unique="true">(特殊的多對一映射,實際就是一對一)來關聯table2. 當hibernate查找的時候,table2裏的數據沒有與table1相匹配的,這樣就會報No row with the given identifier exists這個錯.(一句話,就是數據的問題!,註意你的數據就可以)

No row with the given identifier exists