使用持續性單元 (persistence.xml)

您可以使用「持續性 XML 編輯器」來編輯 persistence.xml 檔。

關於這項作業

persistence.xml 檔說明 JPA 專案中的持續性單元的詳細資料。持續性單元包含一連串的 Entity Bean。

「持續性 XML」編輯器」讓您輕鬆地變更 persistence.xml 檔:

  • 新增及移除持續性單元。
  • 修改持續性單元的內容。
  • 在持續性單元中新增及移除類別。
  • 在持續性單元中新增及移除內容。
提示: 有關具有 JPA 2.1 版的專案,請參閱 Eclipse persistence.xml 編輯器。

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

如果要編輯 persistence.xml 檔, 請完成下列步驟。

程序

  1. 在「套件瀏覽器」視圖中,用滑鼠右鍵按一下您要編輯的 JPA 專案的 persistence.xml 檔,然後選取開啟工具 > 持續性 XML 編輯器。
  2. 在「持續性 XML 編輯器」的「設計」標籤中,對 persistence.xml 檔進行下列任何變更:
  3. 按一下檔案 > 儲存,以儲存您所做的變更。
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: last_date

File name: t_editing_persistence.html