Sun Specific Settings - CMP Database

EJB JAR file -> Relationships tabbed pane -> Sun-specific Settings button

Or

EJB JAR File -> General tabbed pane -> Sun-specific Settings button

Or

Enterprise Bean -> General tabbed pane -> Sun-specific Settings button

Or

Enterprise Bean -> Entity tabbed pane -> Sun-specific Settings button

The CMP Database dialog box enables you to edit the runtime container-managed persistence properties of the EJB JAR file specific to Sun Java System Application Server.

Specify the JNDI name available on the server instance where this EJB JAR is being deployed. For example, for the CMP Roster sample application, the JNDI name is jdo/cmp-roster.

This name is used at runtime to manage persistent resources.

The Create Database Mappings button opens the Create Database Mappings dialog box for this EJB JAR. You can specify how you would like to map the enterprise beans in this EJB JAR to a database. The options are

Automatic Table Generation Mode:

The Table Generation Settings button opens the Table Generation Settings dialog box for this EJB JAR file. The Table Generation Settings dialog box allows you to specify whether CMP tables must be created during deployment of modules and deleted when a module is undeployed. The button is available only in the automatic table generation mode.

From the Enterprise Bean drop down list, choose the enterprise bean for which you wish to define CMP settings.

In the automatic table generation mode, the primary table is already defined and the Primary Table drop-down list is disabled.

Click the Advanced Settings button to define the consistency level in the Advanced Settings (Table Generation Mode) dialog box.

The Field Mappings section displays mappings for the persistent fields.

Mapping Mode:

From the Enterprise Bean drop down list, choose the enterprise bean for which you wish to define CMP settings.

Choose the primary table from the list of available primary tables.

Click the Advanced Settings button to choose the schema file, define the consistency level and choose one or more secondary table(s) in the Advanced Settings (Mapping Mode) dialog box.

In the Field Mappings section, you can map a field to a column by selecting the column in the drop-down list for that field.

You can map the fields on the currently selected enterprise bean by selecting Automap All. Automap All will make the most logical selections and update all the mappings including relationship fields. However, clicking Automap All will override all current mappings.

The Unmap All button will remove all mappings for the currently selected enterprise bean.

NOTE: If you are using a mapping file (sun-cmp-mappings.xml) without capturing the database meta data (a schema file), DeploymentTool can not show this mapping in the Field Mappings table. However, this mapping file is still valid and deployable. You can continue to use this mapping file, or click Create Database Mappings button to create a new mapping.

See also

Create Database Mappings

Advanced Settings (Mapping Mode)

Advanced Settings (Table Generation Mode)

Edit Column Type

Map Field to Multiple Column

Primary and Secondary Tables

Mapped Secondary Table Setup

Relationship Mapping Editor Overview

Mapped Secondary Table Editor


Legal Notices