Working with persistence units (persistence.xml)

You can edit the persistence.xml file with the Persistence XML Editor.

About this task

The persistence.xml file describes the details of the persistence units in your JPA project. A persistence unit contains a list of entity beans.

The Persistence XML editor simplifies making changes to the persistence.xml file:

The persistence.xml file is located in the META-INF directory of the JPA project.

To edit the persistence.xml file:

Procedure

  1. In the Package Explorer view, right-click the persistence.xml file of the JPA project that you want to edit and select Open with > Persistence XML Editor.
  2. In the Design tab of the Persistence XML Editor, make any of the following changes to the persistence.xml file:
    • Add or remove persistence units.
    • Modify the persistence unit details.
    • Add or remove classes for a persistence unit.
    • Add or remove additional properties of a persistence unit.
  3. Click File > Save to save your changes.

Feedback