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:

  • Add and remove persistence units.
  • Modify the properties of a persistence unit.
  • Add and remove classes in a persistence unit.
  • Add and remove properties in a persistence unit.

The persistence.xml file is 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.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: t_editing_persistence.html