Adding fields to CMP entity beans in domain modeling class diagrams

You can use domain modeling class diagrams to add fields to container-managed persistence (CMP) entity beans and define them as key fields.

Before you begin

You must have a domain modeling class diagram open.

Procedure

  1. In the diagram editor, right-click a CMP entity bean; then click Add EJB > CMP Fields.
  2. In the CMP Fields wizard, click Add.
  3. In the CMP Attributes window, specify a name and a type for the CMP field, specify its array dimension or define it as a key field, and click Apply.
  4. Click Finish.

Results

A field is added to the CMP entity bean and is displayed on the diagram.
Tip: You can also use the action bars in the diagram editor or the EJB Deployment Descriptor to add fields to CMP entity beans.

Feedback