7.2. The Three Entity Beans

We're now ready to examine the entity beans for LineItem EJB, Order EJB, and Customer EJB. Because we're using container-managed persistence, the implementation code is much shorter than comparable code with bean-managed persistence. The trade-off is that we'll spend more effort on the deployment descriptor since more information is now declarative.

As we present code for each entity bean, we'll also present the relevant declarative information. This information appears in the XML deployment descriptor stored in the JAR file with the entity beans. We package the three entity beans in the same JAR file along with the session facade bean, CustomerSession EJB, which we will show you later in this chapter.

The Big Picture ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications 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.