Writing the Entity EJB Class


The EJB class provides the API for mapping the attributes of the entity bean to the persistent storage. The naming convention for the EJB class used in this chapter is to append BMPBean or CMPBean to the name of the remote interface. The EJB class for Book is therefore BookBMPBean for the BMP example and BookCMPBean for the CMP example. The EJB class must be a public class that implements the javax.ejb.EntityBean interface.

The code written by the bean provider for the implementation of the entity bean is significantly different depending on whether BMP or CMP is being used to manage persistence. The first notable difference is that a CMP entity EJB is written as an abstract class, whereas a BMP entity EJB is fully implemented by the bean provider as a concrete class. This is true because the getters and setters for the container-managed fields are abstract methods when CMP is used.

Refer to the "Bean-Managed Persistence Example" for further information on implementing BMP, and the "Container-Managed Persistence Example" for further information on implementing CMP.



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net