1. 程式人生 > >springboot使用遇到問題:Class “model.Address” is listed in the persistence.xml file but not mapped

springboot使用遇到問題:Class “model.Address” is listed in the persistence.xml file but not mapped

src java entity map png nbsp http 遇到 res

報錯如下:

技術分享圖片

解決如下:

這是一個Eclipse的怪癖。我最近在創建一個禁用了JPA庫配置的新JPA項目時遇到了這個問題,但是我通過Eclipse New JPA Entity向導創建實體之前沒有手動配置JPA庫創建實體後,我在項目的構建路徑中配置了JPA庫(只需在庫中添加目標Java EE服務器運行時),但驗證錯誤仍然存??在。我可以通過以下至少一種方式解決它:

  1. 右鍵單擊persistence.xml文件,JPA工具 - > 同步類列表
  2. 或者,右鍵單擊項目,驗證
  3. 或者,關閉/重新打開項目。

技術分享圖片

springboot使用遇到問題:Class “model.Address” is listed in the persistence.xml file but not mapped