The javax.ejb Package for Entity Beans

Yesterday, you saw the interfaces and classes in the javax.ejb package that related to Session beans. Figure 6.2 shows the interfaces and classes relevant to Entity beans.

Figure 6.2. The javax.ejb interfaces and classespertaining to Entity beans.

As you can see, many of the supporting classes are common, which is good news because that means there's less to learn. The principle differences are as follows:

  • The Entity bean implements javax.ejb.EntityBean rather than javax.ejb.SessionBean, and there is a different lifecycle.

  • The Entity bean is initialized with an EntityContext rather than ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition 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.