The Mappings tab is the tab which contains the information and editors for working with the mappings of the table valued function call definition on a target table valued function in the Relational Model Data. It also contains the mappings of the return element onto the resultset of the target table valued function. The different parts are described below.
A table valued function call can be mapped to multiple target table valued functions, one table valued function per database type. A database type represents a single Relational Model Data Storage container, you can have one of these per database type per project.
In general mappings are created through reverse engineering using the catalog explorer. The following section describes how to do this process manually. To map a table valued function call manually to a target table valued function, you first select the Relational Model Data Storage container using the combo box called Database type. Then, you click the Create mapping button to create a mapping definition for this table valued function call. The Remove mapping button removes the mapping definition. Each mapping connects a model element (table valued function call definition) and a Relational Model Data element, a table valued function, which is called the target of the mapping. To select which table valued function a stored procedure call maps to for the chosen database type, select the target from the combo box called Target. To view the specifics of the target chosen, click the button next to the target combo box to look it up in the Catalog Explorer.
Below the information for the table valued function call mapping are the mappings per table valued function call parameter shown in their own sub-tab, called Parameter mappings. Per parameter which should be mapped the .NET type of the table valued function call parameter is given and the target parameter it is mapped on. The target parameter is a parameter in the Target of the mapping. To select a target parameter, click the cell in the Target element name column to open the selector to pick the specific target parameter. The details about the selected target parameter are shown in the selector and for the selected parameter mapping also below the grid in the Target element details section, which is described below.
LLBLGen Pro contains auto-map functionality which already pre-selects target parameters based on table valued function call parameter name and type specifics. This greatly reduces time spend on mapping a table valued function call to a target.
Sometimes the .NET type of the table valued function call parameter and the target parameter don't match. To match them, use a type converter and assign it to the particular parameter mapping by clicking the cell in the column 'TypeConverter to use'. Type converters on table valued function calls are supported only by the LLBLGen Pro RTL target framework.
The bottom section of the Parameter mappings tab contains the Target element details section, which displays the specific aspects of the target parameter of the selected row in the parameter mapped grid.
Next to the Parameter mappings sub-tab the tab with the mappings of the return element of the Table Valued Function Call onto the resultset of the target table valued function are shown. Per return element field the .NET type of the field is given and the target field it is mapped on. The target field is a field in the resultset of the target table valued function. To select a target field, click the cell in the Target element name column to open the selector to pick the specific target field. The details about the selected target field are shown in the selector and for the selected field mapping also below the grid in the Target element details section, which is described below.
Sometimes the .NET type of the return element field and the target field don't match. To match them, use a type converter and assign it to the particular field mapping by clicking the cell in the column 'TypeConverter to use'.
To synchronize the type specifics (.NET type, length, precision, scale) between the typed view field and the mapped target field, you can use the Sync selected... button. You have two choices:
When there are some unmapped target fields in the Target of the mapping and you want to reverse engineer them to new fields in the return element using the reverse engineering functionality of the designer, click the button Reverse-engineer unmapped target fields.
The bottom section of the Field mappings tab contains the Target element details section, which displays the specific aspects of the target field of the selected row in the field mapped grid. You can't edit a target field in a table valued function resultset nor create new ones so they're disabled.