Java Reference
In-Depth Information
The last screen in the wizard allows us to specify the package for the generated
session beans and whether we want to generate local and/or remote interfaces.
After clicking on Finish , the session beans are created and placed in the package
we specified.
All of the generated session beans extend AbstractFacade , an abstract class that is
also generated by the Session Beans for Entity Classes wizard. This abstract class
contains a number of methods that allow us to perform CRUD (short for Create,
Read, Update, and Delete) operations on our entities. The code is as follows:
package com.ensode.ejbdao.sessionbeans;
import java.util.List;
import javax.persistence.EntityManager;
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
public AbstractFacade(Class<T> entityClass) {
this.entityClass = entityClass;
}
protected abstract EntityManager getEntityManager();
 
Search WWH ::




Custom Search