Creating a session bean
In this section, we shall create a wrapper session bean for the entity bean. In the session bean, we shall add query methods corresponding to the named queries defined in the entity beans. We shall add a method to create test data, and a method to delete data. Also, we shall add remove methods to remove Catalog, Edition, Section
, and Article
entity instances. To create a session bean, select File | New, and in the New Gallery window, select Business Tier | EJB in Categories and Session Bean in Items. Click on OK:
In the EJB Name and Options window, specify an EJB Name (CatalogSessionEJB), and a Mapped Name (EJB3-SessionEJB), which is the global JNDI name for the session bean. Click on Next, as shown:
In the Session Façade-Select JPA Entity Methods, select the default methods and click on Next. In the Class Definitions window, specify the bean class name (model.CatalogSessionEJBBean) and click on Next, as shown in the following screenshot:
In the EJB Home and Component...