Creating a session bean
As mentioned before, one of the best practices when developing entity beans is to
wrap them in a session bean for a client. In this section we create a session bean,
which will be a wrapper for the entity bean. Select the Model project and select
File>New . In the New Gallery window, select Business Tier>EJB and select Session
Bean . Click on OK . In the Create Session Bean window, specify an EJB Name.
Select the default EJB 3.0 Options : Session Type as Stateless and Transaction Type
as Container . The Mapped Name is used in the remote JNDI lookup of the session
bean. Click on Next . In the Session Façade window, select the default JPA entity
methods to expose. Click on Next . In Class Definitions, specify the Bean Class and
click on Next . In EJB Home and Component Interfaces specify, which interfaces to
implement and specify the interface names. Click on Next . The Summary page lists
the session bean class and interfaces to be generated. Click on Finish . A session bean
class and the remote and home interfaces get generated.