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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.