Entering content frame

Function documentation Container-Managed Relationships Locate the document in its SAP Library structure

Use

Entity beans with container-managed persistence can participate in relationships between each other. This enables you to develop complex applications consisting of interrelated container-managed entity beans.

Features

Container-managed relationships are realized using cmr-fields described in the deployment descriptor(s). Entity beans access their related container-managed entity beans using get and set accessor methods for these fields.

Container-managed entity beans can access each other only through local interfaces. If a bean does not provide a local view, it cannot be related by other container-managed entity beans.

Relationships can be unidirectional or bidirectional.

In unidirectional relationships, only one of the entity beans participating in the relationship has a cmr-field on the side that refers to the other container-managed entity bean. This means that the relationship can be navigated in one direction only. However, even though an entity bean participates in a unidirectional relationship, it can still be affected if you change that relationship. Container-managed entity beans, which do not provide a local view, can only participate in a unidirectional relationship from themselves to other entity beans.

In bidirectional relationships, both entity beans have a cmr-field that refers to the other entity bean. In this way these relationships can be navigated in both directions.

Container-managed relationships can be one-to-one, one-to many, and many-to-many depending on the number of entities of each bean class that can participate in a container-managed relationship.

For more information about creating container-managed relationships with the NetWeaver Developer Studio, seeCreating Beans Relationships.

 

Leaving content frame