Mapping Tables Overview
Mapping Tables allow a GenRocket generated value to be mapped as a key to other value(s) generated from another source (e.g., a Database ID or a REST response value). The created key value can be referenced in subsequent Scenarios to retrieve the source value.
Mapping Tables Overview
A mapping table requires, at minimum, three columns:
- Namespace – Defines the namespace the key-value pair will uniquely belong to (e.g., Department, User, Address).
- Key – The GenRocket generated value.
- Value – The actual source value (e.g., a Database ID or a REST Response value).
Mapping Table Example
The mapping table below is for a user namespace with:
- A Key between 100000 and 100004
- A Value between 247556 and 247562
The Namespace column is not required when key-value pairs are based on only one namespace. In this example, we have two namespaces, Department and User.
Using Mapping Tables for Data Consistency
A mapping table is used to ensure that the appropriate source value is retrieved via a given key value. For example, in the table below, if the key value is 100002, then the source value equals 247560.
Mapping Tables Usage Example
GenRocket is used to populate data into two tables: User Table and Address Table. The User Table creates its own primary id, which is then mapped to the GenRocket generated value.
The Address Table has a Parent/Child Relationship with the User Table. Since the Address Domain references the User Domain as its parent, it will inherit the same user ids generated from the User Domain (e.g., 100000, 100001, 100002, etc.).
Thus, the GenRocket generated user id will be located within the mapping table, in the Key column, and the value in the Value column will be returned.