Designing the BMP Entity Bean

Figure 10.2 shows the design of the Student component. The StudentEJB bean-managed entity bean implements the javax.ejb.EntityBean interface. It implements the methods setEntityContext(), unsetEntityContext(), ejbActivate(), ejbPassivate(), ejbLoad(), ejbStore(), and ejbRemove() as defined in the javax.ejb.EntityBean interface. It also implements the ejbCreate() and ejbPostCreate() methods.

Figure 10.2. Student entity bean design.

A StudentEJB entity bean class consists of the persistent fields studentId, firstName, lastName, and address. You code them as instance variables in the entity bean class. A Student entity ...

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.