Show TOC Start of Content Area

Procedure documentation Creating and Editing the Enterprise Beans' Methods  Locate the document in its SAP Library structure

Use

You can create the bean’s business methods when you create the enterprise bean, or later when you develop the bean’s business logic. When you create the bean, the SAP NetWeaver Developer Studio generates the default methods, but you can edit them afterwards, and add the additional methods that are required by the logic of your bean.

The Developer Studio provides an editor that allows you to manage the methods easily without having to modify directly the source code. All changes that you make using this procedure automatically lead to the generation of the corresponding changes in the Java source code.

Note

When you create container-managed persistent fields and container-managed relationship fields for container-managed entity beans, the Developer Studio automatically generates the corresponding accessor methods (get and set accessor methods).

Prerequisites

·        The enterprise bean is created.

·        When developing the business logic of your EJB applications, make sure that you observe the following naming conventions:

¡        The names of business methods and attributes of the bean class must not start with an ejb prefix.

¡        The names of the business methods in the remote interface must not start with an ejb or p4 prefix.

Procedure

...

       1.      From the J2EE Explorer pane, choose your EJB Project ejb-jar.xml the enterprise bean whose methods you want to modify

       2.      From the context menu, choose Open.

The right-hand pane displays the bean properties.

       3.      Choose the Methods tab

       4.       

If You Want To

Then

Create new methods

...

                            a.      From the tree structure in the Methods tab, select the type of the method that you want to create

                            b.      Choose add

                            c.      In the corresponding fields, enter the method’s name, return type, and parameters

Edit an existing method

...

                            a.      From the tree structure in the Methods tab, select the corresponding method

                            b.      Edit the corresponding method fields

Edit the generated ejbCreate method

...

                            a.      From the tree structure in the Methods tab, select EJB Methods Create Methods ejbCreate

Note

You can modify the parameters of the ejbCreate method only.

                            b.      Add new or edit the existing method parameters

 

Note

The Methods tab of message-driven beans is disabled and you cannot perform any of the actions described above. This is due to the logic of the message-driven bean architecture.

Furthermore, you cannot edit the generated get and set accessor methods for the persistent fields you have created in your container-managed entity beans. You can only view these methods in the Business Methods sub-node.

 

 

 

End of Content Area