Entity Bean Methods

The entity bean class implements the javax.ejb.EntityBean interface. Therefore, you need to implement the setEntityContext, unsetEntityContext, ejbActivate, ejbPassivate, ejbLoad, ejbStore, and ejbRemove methods defined in the javax.ejb.EntityBean interface. The bean may implement ejbCreate<method>(...) methods (and corresponding ejbPostCreate<method>(...) methods) used to initialize the bean instance. In addition, the bean class can implement business methods, home methods and remove methods. We'll discuss each of them in detail in the following sections.

setEntityContext and unsetEntityContext Methods

The EJB container calls the setEntityContext method to set the associated entity context. The entity context provides access ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.