21.5. Bean Relationships
An added wrinkle to container-managed persistence is the idea of container-managed relationships (CMR). Because we are modeling only a single entity bean, there aren't any relationships to be considered. If we were to convert other classes to entity beans, however, it would then be necessary to describe how these entity beans are related to one another. Relationships may be characterized as one-to-one, one-to-many, many-to-one, or many-to-many; they can also be further categorized as unidirectional or bi-directional.
For example, if we were to create a Team entity bean, then we would want to describe the relationship between the Team and Game objects using CMR. What is being described is a physical relationship—what data ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access