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
Automatically Generate Necessary Tables - By default, this option is selected.
Map to Tables in Database Schema File
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.
Field - This column lists the fields to be persisted. These fields are selected in the Entity tabbed pane of the enterprise bean. This column is always disabled. To add or remove the fields to be persistent fields, use the Entity tab.
Mapped Column - This column displays the columns mapped to the persistent fields in the database. This mapping can not be modified.
Type - Click this column to change the type in the Edit Column Type dialog box.
Fetch - This column specifies the fetch group configuration for fields and mappings. A field may participate in a hierarchical or an independent fetch group.
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.
Field - This column lists the fields to be persisted. These fields are selected in the Entity tabbed pane of the enterprise bean. This column is always disabled. To add or remove the fields to be persistent fields, use the Entity tab.
Mapped Column -The Mapped Column allows you to change the mappings for the persistent field. Select mapping from the drop-down list. If you select the map multiple columns option from the list, Map Field to Multiple Columns dialog box is displayed.
Type - The Type column displays the data type of the selected Mapped Column. This column is disabled in the mapping mode.
Fetch - This column specifies the fetch group configuration for fields and mappings. A field may participate in a hierarchical or an independent fetch group.
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.
Advanced Settings (Mapping Mode)
Advanced Settings (Table Generation Mode)
Relationship Mapping Editor Overview