Show TOC

Procedure documentationCreating JPA Projects in the Developer Studio Locate this document in the navigation structure

 

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 Note

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

End of the note.

Procedure

Creating New JPA Projects and Configuring the JPA Facet
  1. Choose the New (New) pushbutton.

  2. Select   JPA   JPA Project  , 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.

    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 New pushbutton to create a new EAR project.

      More information: Creating Enterprise Application Projects

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

    For more information, refer to 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 JPA in the properties tree.

  2. Select a platform from the Platform dropdown list.

    If you are using SAP's implementation of JPA as the persistence provider (the default in AS Java), select SAP implementation of JPA.

  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.

    More information about creating connections:

    Creating Connections to the Java Dictionary

    Creating Database Connections

  4. (Optional) In the Persistent class management area, specify if you want the classes that are annotated as entities to be listed in the persistence.xml explicitly or discovered automatically.

  5. 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.

  6. 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, refer to Configuring the JPA Facet above.