1. 程式人生 > >Hibernate主鍵不能被修改

Hibernate主鍵不能被修改

Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from Hibernate的提示錯誤 
Caused by: org.hibernate.HibernateException: identifier of an instance of .[類名]. is alterde from [數字] to [數字]

原因:是由於在一個事務中更新了主鍵,而主鍵是不能被更新的. 然而資料庫中是可以修改的。通過set