Show TOC

Creating JPA Projects in the Developer StudioLocate this document in the navigation structure

Use

To benefit from the JPA tool support provided by Dali, you need a project with JPA support that is enabled by the Java Persistence facet (also referred to as JPA facet ). You can either create a new JPA project or add the Java Persistence facet to existing projects (EJB, Dynamic Web or other).

Note

Use this procedure if you want to develop your entities separately from other application components.

Procedure

Creating New JPA Projects and Configuring the JPA Facet

  1. Choose the New pushbutton.

  2. Select Start of the navigation path JPA Next navigation step JPA Project End of the navigation path, then choose Next .

  3. Specify the JPA project settings:

    1. Fill out the Project name field.

    2. Select SAP Libraries from the Target Runtime dropdown list.

    3. (Optional) Select a configuration template from the Configurations dropdown list.

      To specify the facets you want to add to the project, choose Modify .

    4. If you want to add your JPA project to an enterprise archive immediately, select the Add project to an EAR checkbox, then select an existing EAR project from the EAR project name dropdown list, or choose the associated New pushbutton to create a new EAR project.

      For more information, see Creating Enterprise Application Projects .

  4. To specify the JPA configuration settings immediately, choose Next twice.

    For more information, see Configuring the JPA Facet below.

  5. Choose Finish .

Configuring the JPA Facet

  1. If you are about to configure the JPA facet for an already existing project, open the project properties dialog:

    1. In the Project Explorer , select the project and choose Properties in the context menu.

    2. Choose Java Persistence in the properties tree.

      Note

      The Java Persistence option is present if the JPA facet has already been added to this project.

      If you are about to configure the JPA facet while creating a project, choose Further configuration available .

  2. Select a platform from the Platform dropdown list.

  3. If you want to validate your entities' object-relational mapping with a database schema, select a connection profile from the Connection dropdown list or choose Add connection to create a new connection.

    For more information about creating connections, see:

    Creating Connections to the Java Dictionary

    Creating Database Connections

  4. If you want to specify the object-relational mapping in a separate file using metadata, select the Create orm.xml checkbox.

    If you want to use annotations for object-relational mapping specification within the entities' classes, deselect the Create orm.xml checkbox.

    For more information about using orm.xml , refer to the Dali Java Persistence Tools User Guide , provided by the SAP NetWeaver Developer Studio help content.

  5. If you are in the Properties dialog, choose Apply , then choose OK .

Adding JPA Support to Existing Projects in the Developer Studio

  1. In the Project Explorer , select the project to add JPA support to, and choose Properties in the context menu.

  2. Choose Project Facets in the properties tree.

  3. Select the Java Persistence checkbox, choose Apply , then choose OK .

  4. Configure the JPA Facet .

    For more information, see Configuring the JPA Facet above.