Managing Container-Managed Relationships

See Also

CMP relationships are managed by the container based on how the relationships are described in the ejb-jar.xml general deployment descriptor.

To modify CMP relationships in ejb-jar.xml:

  1. In the Projects window, expand the Configuration Files node for the EJB module project and double-click ejb-jar.xml.
  2. In the top of the graphical editor, click CMP Relationships.

    The visual editor displays a table of the existing container-managed relationships for the EJB module.

  3. Double-click the name of the relationship in the table to open the Edit CMP Relationship dialog box.
  4. Edit the relationship description properties in the dialog box.
  5. Click OK.

To remove a CMP relationship in ejb-jar.xml:

  1. In the Projects window, expand the Configuration Files node for the EJB module project and double-click ejb-jar.xml.
  2. In the top of the graphical editor, click CMP Relationships.

    The visual editor displays a table of the existing container-managed relationships for the EJB module.

  3. Select the name of the relationship in the table and click Remove

Creating a CMP Relationship

If you are you are generating CMP entity beans from scratch and need to specify the CMP relationships for your application, you need to edit the deployment descriptor file in the XML editor. You also need to make the corresponding changes in your source code. When working with CMP entity beans, the IDE does not update your source code based on changes you make in ejb-jar.xml.

To create new CMP relationships in ejb-jar.xml:

  1. In the Projects window, expand the Configuration Files node for the EJB module project and double-click ejb-jar.xml.
  2. Click the XML tab and edit the deployment descriptor file in the XML editor.

Each CMP relationship requires the following.

Notes:

For a complete list of configurable properties for all J2EE module types, see "Appendix A Deployment Descriptor Files" in the Sun Java System Application Server Developer's Guide.

For a detailed description of CMP entity bean specifications, see the Enterprise JavaBeans Specification, v2.1.

See Also
About Deployment Descriptors
Configuring EJB Deployment Descriptors
About Configuring EJB Modules
Generating CMP Entity Beans from a Database

Legal Notices