Entering content frame

Procedure documentation Creating Entity Beans Locate the document in its SAP Library structure

Use

This describes the wizard. Enterprise beans can also be created quickly through the context menus of the relevant projects.

Prerequisites

An EJB Module project exists.

Procedure

       1.      Choose File ® New ® Other...

       2.      On the left pane of the first wizard page, choose J2EE ® EJB, and on the right pane, select EnterpriseBean.

       3.      Choose Next.

       4.      In the EJB Name field, enter a name for your new entity bean.

       5.      In the EJB Project field, select the project to contain the entity bean.

       6.      In the Bean Type field, select Entity Bean.

       7.      In the Default Package field, enter a package.

If the package does not exist, you can create it now.

       8.      Select Generate default interfaces.

Alternatively, deselect Generate default interfaces. You will then be able to specify the interfaces to be generated or used. For example:

This graphic is explained in the accompanying text

       9.      Choose Next.

   10.      Select the persistence type – Container Managed Persistence or Bean Managed Persistence.

If you chose Container Managed Persistence, you can add or remove persistence fields. You can also add or remove fields later during editing.

   11.      Choose Next.

   12.      Add superclasses if required.

   13.      Choose Next.

   14.      Add new methods.

You can miss out this step and add the methods later during editing.

For each new method, select the type of method and choose Add. Enter the name and return type, and specify the parameters.

   15.      Choose Finish.

Result

If you created the enterprise bean in a normal project, you will see something like this in the J2EE Explorer view:

This graphic is explained in the accompanying text

If you created the enterprise bean in a DC project, you will see something like this in the J2EE DC Explorer view:

This graphic is explained in the accompanying text

You can now edit the entity bean.

Related Procedures

Editing Enterprise Beans

Creating and Editing the Enterprise Beans’ Methods

 

Leaving content frame