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.
Choose the (New) pushbutton.
Select
, then choose Next.Specify the JPA project settings:
Fill out the Project name field.
Select SAP Libraries from the Target Runtime dropdown list.
(Optional) Select a configuration template from the Configurations dropdown list.
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
To specify the JPA configuration settings immediately, choose Next.
For more information, refer to Configuring the JPA Facet below.
Choose Finish.
If you are about to configure the JPA Facet for an already existing project, open the project properties dialog:
In the Project Explorer, select the project and choose Properties in the context menu.
Choose JPA in the properties tree.
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.
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:
(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.
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.
If you are in the Properties dialog, choose Apply, then choose OK.
In the Project Explorer, select the project to add JPA support to, and choose Properties in the context menu.
Choose Project Facets in the properties tree.
Select the Java Persistence checkbox, choose Apply, then choose OK.
Configure the JPA Facet.
For more information, refer to Configuring the JPA Facet above.