Examining Container-Managed Relationships

As with a table in a relational database, an entity bean may be related to other entity beans. With BMP entity beans, you need to write code to manage the relationships. With CMP, you declare the relationships in the deployment descriptor and the container generates the code to manage the relationships. An entity bean relationship field represents a relationship to another entity bean. The EJB container provides automatic management of both the persistent state of an entity bean and its relationships to other entity beans.

Local interfaces provide the foundation for container-managed relationships. An entity bean uses its local interface to maintain its relationships to other entity beans. Also, the bean ...

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.