Show TOC Start of Content Area

Procedure documentation Creating EJB 2.1 Components  Locate the document in its SAP Library structure

Use

In this document you can find the differences between the wizards for creating Enterprise JavaBeans (EJB) 2.1 components and Enterprise JavaBeans (EJB) 3.0 components in the Developer Studio. They are both created using the EJB Project wizard but with different project facets for each version.

Procedure

1. Create an EJB Project

...

       1.      In the context menu of the Project Explorer, choose New EJB Project. Choose Next.

       2.      Enter the name of the EJB project and select SAP Web J2EE 1.4 Project in the Configurations field. In the Target Runtime field, select SAP Libraries. This automatically sets the necessary libraries for building the project as specified in the Configurations field. Choose Next.

       3.      Define the project facets. You can save the currently selected facets; these are the default facets for the SAP Web J2EE 1.4 Project which you chose in the Configurations field. The default facets are:

       EJB Module with version 2.1

       Java 5.0, but you can change the version to Java 1.4 and Java 1.3

       SAP Specific EJB Module with version 2.1

You can optionally add Java Persistence, and EJBDoclet facets.

Note

You can change the project facets later at any time from Properties Project Facets in the context menu of the project.

       4.      Choose Finish.

More information: Creating EJB 3.0 Projects in the Developer Studio

2. Create Session and Message-Driven Beans

The wizards for creating enterprise beans in EJB 2.1 components are different from those in EJB 3.0 components.

In EJB 2.1 components you can create enterprise beans using the same wizard. Unlike EJB 3.0 components, in EJB 2.1 components you can create not only session and message-driven beans but entity beans as well.

 

i...

       1.      In the context menu of the EJB Project, choose New  EnterpriseBean.

       2.      In the first page of the New EJB wizard enter the name of the bean and select the bean type. Choose Finish.

Note

The entity beans are no longer part of the EJB 3.0 Specification. You can create them only in EJB 2.x components.

More information about creating:

       session beans 3.0: Creating Session Beans in the Developer Studio

       message-driven beans 3.0: Creating Message-Driven Beans in the Developer Studio

3. Edit Deployment Descriptors

When you create an EJB Project, the Developer Studio automatically creates both ejb-jar.xml and ejb-j2ee-engine.xml. You can use the multipage editor for editing the deployment descriptors to configure your EJB components.

More information:

      ejb-j2ee-engine.xsd

      ejb-j2ee-engine_3_0.xsd

End of Content Area