Show TOC Start of Content Area

Procedure documentation Editing the EJB JAR Persistent Mappings  Locate the document in its SAP Library structure

Use

The persistent mappings are required for the relations between container-managed entity beans. They show how one container-managed entity bean maps its fields to the fields of the referenced bean. There can be one-to-one, one-to-many and many-to many unidirectional or bidectional relations.

For relation type many-to-many, a help table is used that provides mapping between the table fields of each entity bean that takes part in the relation.

Procedure

       1.      Choose Persistent Mapping tab.

       2.      In the Persistent Properties Mappings area:

¡        Database Vendor field – the vendor of the database that the EJB JAR uses. The default value is ORACLE.

¡        Data Source Name field – the name of the data source used to establish connection to the database. The default value is defaultDSName.

       3.      In the Relation Field Mapping area, you can manage the details of the entity beans relations as described bellow.

       4.      Save your changes.

Managing Relations

The available options depend on the type of the selected relation.

Relations Table

This has the following rows:

·        EJB Name – the enterprise bean relation field name.

·        CMR Name – the name of the container-managed field.

·        Key Type – the type of the column in the database table.

·        Help Table Name – For relation type many-to-many you must specify the name of the help table in the Help Table Namecolumn. If you have set Key Type as PRIMARY_KEY, you can edit the Help Table Column Name of the target enterprise bean.

If you have set Key Type as NO_KEY, you can edit Target PK Column Name only.

·        Target Key Type – the type of the column in the target database table.

·        Target CMR Name – the name of the target container-managed field.

·        Target EJB Name – the name of the relation target enterprise bean.

Bean Tables

Tables that describe the columns in the beans. They appear below the relations tables. The bean tables provide information about the columns and the values of the tables in the databases where the beans store the information.

The displayed columns depend on the type of the relation of the selection in the relations table:

·        If you select a relation in which one of the beans contains a Key Type or Target Key Type with value NO_KEY, only the table for that bean will be included. This table has two columns:

¡        Column Name

¡        Target PK Column Name

·        If you select a many-to-many relation (both beans have PRIMARY_KEY as a value of Key Type or Target Key Value column), then tables for both beans will be provided. These tables have two columns:

¡        EJB Table Column Name

¡        Help Table Column Name

Result

For more information see Container-Managed Relationships.

 

 

End of Content Area