Meet in the Middle: Manually Mapping Classes to Tables

If you have an existing OOM and PDM, you can define mappings between them manually using the Mapping Editor.

There are no constraints on the way you map your persistent classes. However, there are some well-defined mapping strategies, which are supported by most of O/R Mapping technologies. You should follow these strategies in order to build correct O/R Mapping models. However, minor differences still reside between them which we will raise when necessary.

Note: when your O/R Mapping models are related with a specific technology, for example when you are modeling for EJB 3.0 persistence, there will be some constraints and we provide model checks to help you check the syntax of the mappings you have defined.

In order to define basic mappings, you have to define a data source for your OOM. Then you can define the mapping using the Mapping tab of the OOM object you want to map to a PDM object or using the Mapping Editor.

  1. In the OOM, select Model > Data Sources to open the corresponding list.
  2. Click the Add a row tool to create a data source.

    You can create multiple data sources in the model.

  3. Double-click the data source in the list to open its property sheet.
  4. On the Models tab, click the Add Models tool to select one or more PDMs from the available open PDM as source models for the data source.


  5. Define mappings using the Mapping tab or the Mapping Editor.

    The Mapping Editor is more convenient to use as you can define all the mappings in one place just by some drag and drop actions. However, it is easy to understand the correspondence between OOM elements and PDM elements by using the Mapping tab in objects property sheet. So we will introduce you how to use Mapping definition tab to define mappings in the following sections.

    When you are familiar with O/R Mapping concepts, you can use the Mapping Editor.