Show TOC Start of Content Area

Procedure documentation Creating JPA Projects in the Developer Studio  Locate the document in its SAP Library 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 File New Project… from the main menu.

       2.      Select JPA JPA Project and choose Next.

       3.      Specify the JPA project settings:

                            a.      Enter a name for your JPA project in the Project name field.

                            b.      (Optional) If you want to store the contents of your project in the default workspace, select the Use default checkbox. If you want to use a different location, deselect the Use default checkbox and browse to a new location on the file system.

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

                            d.      Select Default Configuration for SAP Libraries from the Configurations dropdown list.

                            e.      (Optional) If you want to add your JPA project to an enterprise archive, select the Add project to an EAR checkbox, then select an existing EAR project from the EAR Project Name dropdown list or choose New to create a new EAR project.

More information: Creating Enterprise Application Projects

       4.      Choose Next.

       5.      (Optional) Additionally to the Java Persistence facet, select/deselect the project facets that you want to enable/disable for your JPA project.

       6.      To configure the JPA Facet, choose Next.

       7.      Specify the JPA Facet settings:

                            a.      Select a platform from the Platform dropdown list.

Example

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

                            b.      (Optional) 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

                            c.      (Optional) 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.

       8.      Choose Finish.

Adding JPA Support to Existing Projects in the Developer Studio

...

       1.      In the Project Explorer, select the project to add JPA support to.

       2.      In the context menu, choose Properties.

       3.      Select Project Facets from the properties tree, then choose Modify Project.

       4.      Select the Java Persistence checkbox, then choose Next.

       5.      Specify the JPA Facet settings.

For more information about configuring the Java Persistence facet, refer to step 7 in Creating New JPA Projects and Configuring the JPA Facet.

       6.      Choose Finish, then choose OK.

End of Content Area