EJB JAR file -> Relationships tabbed pane -> Sun-specific Settings button
OrEnterprise Bean -> General tabbed pane -> Sun-specific Settings button
OrEnterprise Bean -> Entity tabbed pane -> Sun-specific Settings button
The CMP Resource dialog enables you to edit the container-managed persistence properties of the EJB JAR file.
The JNDI name is for the persistence manager factory that will be used by an enterprise bean for this EJB JAR. Use 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.
The Table Generation Settings button opens the Table Generation Settings dialog box for this EJB JAR file. Check Create Table on Deploy if you want Deployment Tool to create the tables in the database when the EJB JAR file is deployed. Check Delete Tables on Undeploy if you want Deployment Tool to drop the tables from the database when the EJB JAR file is undeployed. Check Generate Unique Table Names to avoid conflicts in table names. Deployment Tool will append a hashcode to the table names, ensuring the table names are unique.
The Create Field Mappings button opens the Create Field Mappings dialog box for this EJB JAR. Select Automatically Generate Necessary Tables to have Deployment Tool generate tables in the database for this enterprise bean. Deployment Tool will attempt to connect to the JNDI name specified in the CMP Resource section. Be sure the JNDI name is correct and the resource is available before attempting to automatically create the tables.
If the connection fails, the Connection to CMP Resource Failed dialog box appears. You can specify a different JNDI name for the CMP resource by selecting Connect to CMP Resource to Generate Tables and entering the JNDI name under CMP Resource JNDI Name. Select Generate Generic Tables for Datasource Type to generate tables for the vendors listed under Datasource Vendor. The possible values are:
If the database tables already exist, you must provide a schema file in the EJB JAR that describes the tables. The schema file is created using the capture-schema command-line tool. If you do not have a schema file in the EJB JAR, close the dialog box, create the schema using capture-schema, and add the schema file to the EJB JAR.
If you have added a schema file to the EJB JAR, select Map to Tables in Database Schema File and select the schema file under Database Schema Files in Module.
The Persistent Field Mappings are the mappings you have defined for this CMP resource. All CMP and CMR fields must be mapped. Select the enterprise bean in the EJB JAR for which you want to create mappings from the Enterprise Bean drop down. Select the primary table which will persist the enterprise bean from the Primary Table drop down. The Field column lists the fields in the selected enterprise bean. The Mapped Column column lists the database column used to persist the CMP field. The Type column lists the database type of the column data. The Fetch column shows the fetch group used for the field.
The Automap All button will attempt to map fields to table columns by matching the names. Clicking Automap All will override all current mappings. The Unmap All button will remove all mappings.