1. 程式人生 > >An association from the table emps refers to an unmapped class: Dept 錯誤解析

An association from the table emps refers to an unmapped class: Dept 錯誤解析

 An association from the table emps refers to an unmapped class: Dept  :
基本上這幾種錯誤

1,檢查你的hibernate.cfg.xml檔案中是否添加了  <mapping resource="xxxx.hbm.xml"/>

2,檢查你的hibernate.cfg.xml檔案中的相關聯的兩個<mapping resource=""/>的順序,可能有其中一個需要引用另一個,但是另一個卻還沒有編譯,就是說被用作外來鍵的表要放在前面
3,檢查你的*.hbm.xml檔名是否正確

4, 檢查你的*.hbm.xml裡面類全名

5.檢查你的*.hbm.xml裡的封裝類的全類名是否寫全了