Home > Data Model Assistant

Define the Data Structure


Data Structure view

The structure of the model can be accessed by selecting the Data structure link in the DMA adaptation. By default, a hierarchy view is used, representing the data structure as a tree. If the table view is used, select Automatic hierarchy and choose Type by container to get a hierarchy view.

In a new data model, there is only one element: the root element.

For adding elements to the data structure and organize them, services are available on each element in the hierarchy:

Memento on data structure icons

field, corresponds to a simple element.

group, corresponds to a complex element outside a table.

table, corresponds to a complex element defined as a table.

group, corresponds to a complex element inside a table.

primary key, corresponds to a simple element defined as a primary key.

foreign key, corresponds to a simple element defined as a foreign key.

Reusable types

When you create a complex element (table or group), it is possible to define it as a reusable type. The table Data types contains these reusable types. After creating the element, the reusable type is available for creating other elements with the same structure.

If, in the hierarchical view, you modify the structure of an element of an existing type, you will modify the structure of the reusable type. As a consequence, you will modify all the other elements using this type at the same time. So, one must be careful when modifying an element based on an existing type.

Adding a table

This service is available from all container elements (root, table, group), except on elements already in a table. To add a new table, select the service Create a table on the parent. In the wizard, enter the table name.

It is possible to create a reusable type from the new table. For this, check Create a reusable type . Or you can use an existing type (saved in the Data Types table). In this case, check Reuse an existing type and select the type to reuse.

After validating the creation, the wizard suggests to create a field as the primary key. Indeed, a primary key is required for a table. If you want to create fields and define them as the primary key, choose 'Yes'; the wizard for creating a field as primary key is displayed; else choose 'No'. It is possible to create several fields for a primary key.

After a last confirmation, the new table appears in the data structure (as well as potential new fields defined as the primary key). Edit the new table to specify other properties.

Adding a group

This service is available from all container elements (root, table, group). To add a new group, select the service Create a group on the parent element. In the wizard, enter the group name.

It is possible to create a reusable type from the new group. For that, check Create a reusable type . Or you can use an existing type (saved in the Data Types table). In this case, check Reuse an existing type and select the type to reuse.

After confirming the creation, the new group appears in the data structure. Edit the new group to specify other properties.

Adding a field

This service is available from all container elements (root, table, group). A field is a simple element. To add a new field, select the service Create a field on the parent element. In the wizard, enter the field name, select the type and specify whether the field is mandatory.

After confirming the creation, the new field appears in the data structure. Edit the new field to specify other properties.

Adding a primary key field

This service is available from table elements. It is possible to create a field and then define it as an element of the primary key in the table properties. This service offers another possibility: creating a field automatically defined as an element of the primary key of the current table. To add a new field to the primary key, select the service Create primary key field on the table. In the wizard, enter the field name and select the type (the field is automatically defined as mandatory).

After confirming the creation, the new field appears in the data structure as an element of the primary key (the table has been updated, the new field has been added to the primary key). Edit the new field to specify other properties.

Adding a foreign key

This service is available from all container elements (root, table, group). It is possible to create a field and then update its properties to define it as a foreign key. This service offers another possibility: automatically creating a field as a foreign key. To add a new foreign key, select the service Create a foreign key on the parent element. In the wizard, enter the field name, the referenced table and specify whether the field is mandatory (the field type is automatically defined as string ).

After validating the creation, the new field appears in the data structure as a foreign key. Edit the new field to specify other properties.

Defining an existing field as a primary key

This service is available from any field of a table (which is not already an element of the primary key). To define a field as an element of the primary key, select the service Define as primary key on the field.

After submission, the field appears in the data structure as an element of the primary key (the parent table has been updated, the field has been added to the primary key).

Removing a field from the primary key

This service is available from any field of a table that is an element of the primary key. To remove a field from the primary key, select the service Remove from primary key on the field.

After submission, the field appears in the data structure as a simple field - not an element of the primary key (the parent table has been updated, the field has been removed from the primary key).

Deleting an element

This service is available from all elements of the data structure, except the root element (it is forbidden to delete the root element). To delete an element of the data structure, select the service Delete on the element.

If the element to be deleted is a complex type which does not use a reusable type, its children will be deleted too. In this case, a confirmation is required before deleting.

After submission, the element has been removed from the data structure.

Duplicating an element

This service is available from all elements of the data structure, except the root element. To duplicate an element of the data structure, select the service Duplicate on the element to copy. In the wizard, enter the name for the duplicated element.

After validation, the selected element is duplicated (all the same properties, except the name). The duplicated element appears in the data structure, at the same level.

Moving an element

There are several ways to move an element in the model:

Home > Data Model Assistant