The information exchanged by an SQL connection is organized into mappings. A connection can have multiple mappings, each specified in its own diagram.
On this page:
A mapping defines which and how model objects and properties in Enterprise Studio are linked to records and columns in an SQL database table. A mapping consists of the following components:
- Tables and columns at the side of SQL, represented by one or more tables.
- Model object types and their properties from Enterprise Studio, represented by metaobjects.
- Model relation types and their properties from Enterprise Studio, represented by metarelations.
- Relations between the Enterprise Studio model elements and the elements in the SQL database.
An SQL connection uses mappings with a regular table. A typical SQL mapping consists of one or more tables with multiple columns and one or more metaobjects or metarelations with one or more properties, linked via mapping relations to each of the table columns.
General structure of an SQL mapping with one table
Example of an SQL connection
In the following example, a connection has been created to exchange information between Enterprise Studio and an SQL database table about projects.
The following figure shows the "Projects" connection with the mapping "Projects".
Example of an SQL connection with one mapping
The mapping in this example contains one mapping table for projects. The figure below shows the mapping between work packages (projects) in Enterprise Studio and elements of the "Projects" database table in SQL.
SQL mapping with one table
In the mapping, the metaobject "Work package" represents the objects of type "Work package" in the model, including properties "sqlID", "start date", "end date", and "costs". Table "Projects" represents the SQL table, including columns "Title", "ID", "startDate", "endDate", and "costs".
The figure below shows the SQL database table "Projects" with its columns with information.
SQL database table "Projects"