Summary

The EJB container provides automatic management of both the persistent state of an entity bean and its relationships to other entity beans. An entity bean that is the target of a container-managed relationship must provide local interfaces. Container-managed relationships may be one-to-one, one-to-many, or many-to-many, and may be bidirectional or unidirectional.

Relationships are implemented as container-managed relationship fields. Similar to persistent fields, container-managed relationship fields are virtual fields that are defined and accessed by public abstract get and set accessor methods in the CMP entity bean class. The relationship fields are also declared in the deployment descriptor.

Container-managed relationships provide ...

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.