Synchronizing persistent classes in the persistence.xml file

After you create persistent classes, you can automatically add them to list of classes in their persistence unit in the persistence.xml file.

About this task

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

To automatically add all persistent classes in your JPA project to the persistence.xml file:

Procedure

  1. In the Package Explorer view, right-click the persistence.xml file.
  2. Select JPA Tools > Synchronize Classes.

Results

The persistent classes in your JPA project are automatically discovered and added to the persistence unit in the persistence.xml file.

Feedback