Chapter 12 Creating Mappings
When you create a mapping, it is displayed in the Mapping list in the lower part of the Mapping Editor dialog box, called the Mappings pane.
The Mappings pane content changes automatically depending on the object you select in the Target pane:
Selected object | Mappings pane displays... |
---|---|
Folder, model or package | A summary of the mappings it contains. |
Object. See Creating a mapping from the Mapping Editor | The same content as the Mapping tab in the object property sheet: Sources of the mapped object, mappings of its sub-objects if any, criteria, and SQL queries to execute the mapping if any. |
Sub-object. See Creating a mapping from the Mapping Editor | The same content as the object mapping property sheet ("Mapped to" expression and the sources of the sub-object, which are PDM, OOM, XSM or CDM source objects for the target object). |
You can create several different mappings for a single target object. Also, the same target object can have several sources. In the following illustration the SALE class has two different mappings Mapping_5 and Mapping_6. Also Mapping-6 has two sources: CITY and SALE.
All the mappings for a selected object in the Target pane are displayed in the Mapping list located in the lower part of the Mapping Editor dialog box. You can select one and modify it using:
The following tools help you manage mappings for a data source in the Mappings pane:
Tool | Description |
---|---|
Create Mapping - Creates a mapping for a data source that you can further define using the Mapped to sub-tab or queries sub-tabs located at the bottom part of the dialog box (PDM data source only). By default, you are prompted to create a data source if no data source exist for the model when you click the Create Mapping tool. Then, you have to declare one or more source models in order to select source objects from a selection list. If sub-objects match, they are automatically mapped. Each time you click the Create Mapping tool for the current object, it creates a new mapping for the same data source if only one data source exists. Otherwise you have to select one from the list of available data sources to proceed. | |
Delete Current Mapping - Deletes the current mapping for the data source. The link that materializes the mapping between the Source and the Target panes is also deleted. | |
Properties - Opens the property sheet of the current mapping. |
You have a target object but you do not know its sources yet. You create a mapping using the Create Mapping tool. The mapping object can be compared to a container for the target object and its source objects. A selection dialog box opens to let you select one or more sources for your target object that is then displayed in the Object Sources sub-tab in the Mappings pane.
Then you have to select the sub-objects (source and target) to map using the sub-object column for the target and the Mapped to column for the source in the Sub-Object mapping sub-tab.
Then you can configure SQL queries using the Criteria, Select, Insert, Update and Delete sub-tab, as a mapping consists in performing modifications in the data source using SQL.
Copyright (C) 2008. Sybase Inc. All rights reserved. |