This procedure describes how to create the necessary development component projects for the simple Java EE 5 application. There are four development components needed: EJB Module, Web Module, Enterprise Application, and Dictionary. The next sections describe how to enable the usage of Java Persistence (JPA) and JavaServer Faces (JSF) technologies when developing the application. Some of the development components (projects) need to be enabled with additional facets.
In your SAP NetWeaver Developer Studio, open the Java EE perspective.
To create a new development component, choose
.Specify the type and name of the development component by following the corresponding instructions:
For EJB Module — choose
. Then enter the name app_ejb and choose Finish.For Web Module — choose
. Then enter the name app_web and then Finish.For Enterprise Application — choose
. Then enter the name app_ear and choose Next, and then select the checkbox indicators for already existing EJB and Web development component projects and choose Finish.Now your Enterprise Application development component has valid references to EJB and Web development component projects.
For Dictionary — choose
. Then enter the name app_dict and choose Next then Finish.From the context menu of the app_ejb (EJB project) choose
.Select the Java Persistence checkbox indicator and choose Next.
From the Platform dropdown menu select SAP implementation of JPA and choose Add connection.
In the New Connection Profile window, choose Java Dictionary, then Next, enter the connection name app_conn, select the Auto-connect at startup indicator and choose Next.
Browse to the dictionary project (app_dict) to which the connection is made and choose Finish.
Choose Finish and then OK.
Now you have created a relation between the EJB project containing the JPA entities, and the data dictionary project utilizing the forward mapping functionality of the toolset. This way you generate the database tables straight from the JPA entities.
From the context menu of the app_web (Web project) choose
.Select the JavaServer Faces checkbox indicator, choose Next and then Finish.
From the dropdown menu select JSF version 1.2.
Select the Server Supplied JSF Implementation radio button.
Choose Finish and then OK.
From the context menu of the app_ear (EAR project) choose
.Select the SAP Data Source Aliases Provider Module checkbox indicator.
Choose Finish and then OK.