原文:hibernate錯誤:Cannot add or update a child row: a foreign key constraint fails

今天對已存在的兩個表中的一個表添加另一個表的主鍵為外鍵,遇到以下錯誤: sql Cannot add or update a child row:a foreign key constraint fails 原因: 設置的外鍵和對應的另一個表的主鍵值不匹配。 解決方法: 找出不匹配的值修改。 或者清空兩表數據。 ...

2017-05-07 16:42 0 1503 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM