1. 程式人生 > >解決Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibe

解決Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibe

Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory

 

日誌提示@Column(name)的註解與資料庫欄位不匹配

如資料庫表已經存在可以先把表清空重建

 

檢查實體類中欄位的型別與資料庫中是否一致

檢查set/get方法返回的型別是否與欄位一致,比如set/get返回的是int 型,而欄位定義的是integer型