Home

 

Creating the EJBBank session bean

To create the session bean, do these steps:

Right-click the RAD75EJB project and select New Æ Session Bean.

In the Create EJB 3.0 Session Bean dialog (Figure | 4-13):

Figure 14-13 Creating a session bean (1)

For Java package type itso.bank.session.
For Class name type EJBBankBean.
For State type select Stateless.
For Create business interface, select Local, and set the name to itso.bank.service.EJBBankService.
Click Next.

In the next dialog, accept the default of Container as transaction type, and click Next (Figure | 4-14).

Figure 14-14 Creating a session bean (2)

In the Select Class Diagram for Visualization dialog, select Add bean to Class Diagram, and accept the default name of classdiagram.dnx.

Click Finish.

When prompted for enablement of EJB 3.0 Modeling, click OK.

Save and close the class diagram.

The EJBBankBean is open in the editor. Notice the @Stateless annotation.

Before we can write the session bean code, we have to complete the business interface, EJBBankService.

ibm.com/redbooks