Container-Managed Relationships

Container-managed relationships are also new in J2EE 1.3 and provide a function where the UML has applicability. The Abstract Persistence Schema discussed earlier has the additional capability to maintain information about relationships between container-managed entity beans using what are referred to as container-managed relationship (CMR) fields. Similar to CMP fields, these also use get and set accessor methods that you define as abstract, and you let the Persistence Manager create and manage the necessary code for them.

In a real J2EE project, it is common for sets of different types of entity beans to be related to one another and therefore require the use of these relationships. Continuing with our example ...

Get Developing Enterprise Java Applications with J2EE™ and UML 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.