Add Persistence to the Project


Use this procedure to add persistence to the Employee project.

  1. Right-click the Employee project in the Explorer and select Java Persistence > Add Java Persistence. The Add Persistence Dialog appears.

  2. On the Add Persistence Dialog select a database connection that you created earlier (see "Create a Database Connection") and click Finish.

    You must be connected to the database before adding persistence to the project.

    Add Persistence Dialog

    This figure shows the Add Persistence dialog.
  3. You can now work in the Persistence Perspective. From the menu bar, select Window > Open Perspective > Other. The Select Perspective dialog appears.

  4. Select Persistence and click OK. The Persistence Outline and Properties views appear.

    Persistence Perspective

    This figure shows the main parts of the Persistence Perspective: The Persistence Outline and Persistence Properties views.

The next step is to Create Java Persistence Entities.