Adding Persistence to a Project


Use this procedure to add persistence to an existing project:

  1. Right-click the project in the Package Explorer and select Java Persistence > Add Java Persistence.

    Adding Persistence to a Project

    Using the Java Persistence > Add Java Persistence menu option.
  2. Complete the fields in the Add Persistence Dialog to select a database connection to use with the persistent project and click Finish.

    • To create a new database connection, click Database Connection use the New Connection wizard.

    • To add the libraries that contain the JPA (Java Persistence API), click Build Path and use the Java Build Path page of the project's properties.

    Add Java Persistence Dialog

    The Add Persistence dialog.
  3. You should now open the Persistence Perspective.

 

Related reference

Add Persistence Dialog
Persistence Perspective

 

Related tasks

Adding Persistence to a Class
Creating a New Persistent Entity

 

Related concept

Understanding Java Persistence