Container-Managed Relationships

Container-Managed Relationships (CMR) might possibly sound daunting, and certainly from the EJB container vendor's perspective, there could be some fairly complex activity happening behind the scenes. However, from the bean provider's perspective (that is, you), they are fairly straightforward and easy to use.

CMR is defined declaratively through the deployment descriptor, underneath the <relationships> element. Therefore, container-managed relationships can only be defined between Entity beans that reside within the same local relationship scope. What this means in practice is that beans that have relationships must be deployed in the same ejb-jar.xml file. You will be learning more about declaring CMRs later ...

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.