一個錯誤與改正 hibernate

進行項目開發時拋出如下異常:

javax.servlet.ServletException: IllegalArgumentException occurred while calling setter of com.lab.domain.LabRoom.device; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.lab.domain.LabRoom.device

這裏的原因是我把device設置成了數組形式,而數組是不允許爲null的所以就會拋出異常,而改成了Set<Device>之後就沒有異常了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章