Adding JPA support to a project

You can add Java™ Persistence API (JPA) support to a faceted project by adding the Java Persistence project facet.

Before you begin

You can add the JPA project facet only to faceted projects - projects that use the faceted project framework for adding functionality. Examples of faceted projects are web projects and an EJB projects. A project facet is a specific unit of functionality that you can add to a project when that functionality is required. When a project facet is added to a project, it can add natures, builders, classpath entries, and resources to a project, depending on the characteristics of the particular project.
Note: Java projects (File > New > Java Project) are not faceted projects by default. To convert a Java project to a JPA project, see Converting a Java project to a JPA project.

About this task

To add JPA support to a project:

Procedure

  1. In the Package Explorer view, select the project and then in the main menu click Project > Properties.

    The Properties page opens.

  2. Click the Project Facets property.
  3. In the list of project facets, select JPA and then, in the Version column, select the version and then click Apply.

    The JPA facet is added to your project.

  4. Select the JPA platform for the JPA facet.
    1. Click Further configuration required.
    2. For the Platform list, select the platform that you want.
      • For JPA 1.0, select RAD JPA Platform 1.0, RAD JPA Platform 2.0, or Generic 1.0.
      • For JPA 2.0, select RAD JPA Platform 2.0 or Generic 2.0.
      • For JPA 2.1, select EclipseLink 2.5.x or Generic 2.1.
  5. Click OK.

    The properties page closes.