Click the Properties button to the right of the Mapping field on the Mapping tab of an object property sheet or in the Mappings pane of the Mapping Editor to open the mapping property sheet. The tabs available for a particular mapping depend on the objects being mapped.
The General tab contains the following properties:
Property |
Description |
---|---|
Data Source |
Name of the data source where data is extracted. |
Target |
Name of the target object that owns the mapping. |
Parent |
[Sub-object only] Specifies the name of the parent object. |
Name |
Specifies the name of the mapping. |
Code |
Specifies the technical name of the mapping. |
Comment |
Descriptive comment for the mapping. |
Mapped to |
Specifies the mapping expression. You can edit the expression directly in this field or click, the Edit tool to open it in a dedicated editor (see Modifying the Default Mapping Syntax). To recover the default expression click to release the User-Defined button. |
Sources - Lists the source objects mapped to the object. Use the Add Sources tool to add additional source objects to the list.
Sub-Object Mappings - Lists the sub-objects of the mapped object that are mapped with sub-objects of the object.
Click the Ellipsis button in the Mapped to column to edit the source expression for the sub-objects.
Operation Mappings - [OOM classes only] Lists the operations and queries associated with the mapping Allows you to associate a SQL query to the operation. When an operation implies action on the database, like data retrieval or data update, you can associate this operation with a SQL query that will execute an action in the database. Usually, this query is a SELECT statement used to retrieve one or several instances of the current class according to the operation parameter. It can also be an UPDATE query. In the context of an EJB, the SQL query mapped to an operation is used to implement finder or select methods.
Criteria - Allows you to specify join criteria between source objects. For example: EMPLOYEE.ID < 100
Query - Computes a SQL query from the information in the other tabs to retrieve or update data in the database. If you modify the SQL query, it can no longer be automatically calculated, even when you update the mapping. You can recover the computed expression by clicking to release the User-Defined tool.
select USER.USERNAME "USERNAME", USER.PASSWORD "PASSWORD" from USER
insert into USER( USER.USERNAME, USER.PASSWORD) values ( %USERNAME%, %PASSWORD%)
update USER set USER.USERNAME = %USERNAME%, USER.PASSWORD = %PASSWORD%
delete line* from USER
To modify the default syntax of the queries, edit the SelectStatement, InsertStatement, UpdateStatement, and DeleteStatement entries in the Profile category of the object language or extension (see Chapter 3, Extending Your Models with Profiles in Customizing and Extending PowerDesigner ).