將持續性類別同步化到 persistence.xml 檔中

建立持續性類別之後,您可以在 persistence.xml 檔中,讓它們自動新增至其持續性單元中的類別清單。

關於這項作業

persistence.xml 檔位於 JPA 專案的 META-INF 目錄中。

如果要自動將 JPA 專案中的所有持續性類別新增至 persistence.xml 檔,請執行下列動作:

程序

  1. 在「套件瀏覽器」視圖中,用滑鼠右鍵按一下 persistence.xml 檔。
  2. 選取 JPA 工具 > 將類別清單同步化。

結果

會自動探索您 JPA 專案中的持續性類別,並新增至 persistence.xml 檔中的持續性單元。
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: last_date

File name: t_jpa_synchronize.html