About the Table to Entity Retrofit utility

Related Topics

The Table to Entity Retrofit utility can be used to create an entity relationship model (entities, attributes, relationships and unique identifiers) from repository-held relational server models, i.e. relational table definitions. How

Note:	This utility will run only against relational table definitions that are owned by the current workarea. Entities are not created from referenced tables outside the current workarea, or object tables.

Understanding how the utility maps database designs

The ‘Table to Entity Retrofit’ utility transforms (or 'reverse engineers') repository-held relational table definitions into entities, attributes, relationships and unique identifiers as described below:

•	Entity definitions are created from relational table definitions.

•	Attribute definitions are created from any columns that are not involved in foreign key constraints.

•	Relationships are created from the foreign keys of the specified table and the tables to which these foreign keys refer.

Note:	Relationships are created only if both of the tables involved in the foreign key are retrofitted to entities.

•	Primary key constraints are used to create primary unique identifiers.

Note:	If a foreign key is also a primary key for a table both of the tables involved in the foreign key must be retrofitted to entities, otherwise the entity definition will be incomplete.

•	Unique key constraints are used to create secondary unique identifiers.

No attempt is made to derive sub-type information. For example, the utility does not create a sub-type entity for a view that is based on a single table.

Intersection tables become intersection entities. Many-to-many relationships are not derived from intersection tables.

Data warehouse considerations

If your source database tables are targeted for a data warehouse application (i.e.  the Data Warehouse Type property of one or more tables are set to either ‘Fact’ or ‘Dimension’), the entities created are classified likewise, i.e. ‘Fact’ or ‘Dimension’.

Note:	The target container must be an application system and it's Data Warehouse? property must be set to ‘Yes’.


Creating entity models from database tables

Related Topics

You can create entity models (entities, attributes, relationships and unique identifiers) based on relational table definitions recorded in the repository.  About

To create entities based on database tables:

1.	In the Entity Relationship Diagrammer:

(a)	Choose Utilities→Table to Entity Retrofit.

(b)	Select a target application system for your entities.

If a diagram is open, the application system of the current diagram is used.

If preferred, you can use the Repository Object Navigator. Choose Utilities→Designer→Table to Entity Retrofit and then select your target application system.

2.	Click Candidate Tables.

Any relational table definition in the current application system that is not already associated with an entity is presented as a ‘candidate table’. If you have created references to tables in other application systems within this workarea, these tables are also presented.

Entities are not created from referenced tables outside the current workarea. This utility runs only against tables that are owned by the workarea.

3.	Choose one or more tables from which you want to create entities and then click OK. Tip

Note:	Entity relationships can only be created if both of the tables involved in the foreign key are retrofitted to entities.

4.	(Optional)  Change the names, short names or plurals of the entities to be created.

The column widths in the dialog can be adjusted to your requirements. Tip

5.	Choose whether to update relationships and unique identifiers for existing entities.

6.	To create entities from the selected tables, click Retrofit.

7.	Once the process is complete, click Close twice to dismiss the dialogs.

8.	Open the Entity Relationship Diagrammer and display the new entities on an entity relationship diagram:

a	Create a new diagram. How

b	Display the new entities on the diagram. How


To move the cursor up a row in a spreadtable, hold down the CTRL key and press the UP ARROW key.

To move the cursor down a row in a spreadtable, hold down the CTRL key and press the DOWN ARROW key.

To move the cursor across the fields in a row in a spreadtable, press the TAB key.

To change the order of the columns, press and hold down the mouse button on the column heading, then drag it to the new position on the spreadtable and release the mouse button.

To change the size of a column, move the cursor over the line at either side of the column you want to resize and press and hold down the mouse button. Drag the cursor to the size to which you want the column to be resized and release the mouse button.

To save the current spreadtable column order and sizes, click Grid Save. To display the current spreadtable with the default column order and sizes, click Grid Reset.


To select multiple elements from the list, hold down the CTRL key and click on the elements you require. To select a block of elements, click on the first element in the list, hold down the SHIFT key and click on the last element in the block.

To choose all elements in the list, click on the Select All button.

To display only some of the elements in the list, filter the list by entering a search string in the Filter field and clicking the Filter button.


Utilities - Table to Entity Retrofit
Table to Entity Retrofit (Utilities Menu)

Related Topics

The ‘Table to Entity Retrofit’ utility transforms (or 'reverse engineers') repository-held relational table definitions into entities, attributes, relationships and unique identifiers.


Table to Entity Retrofit dialog box

Related Topics

The ‘Table to Entity Retrofit’ utility transforms (or 'reverse engineers') repository-held relational table definitions into entities, attributes, relationships and unique identifiers.

Use this dialog to specify the table definitions from which entity definitions are to be created.

Table Name

The names of the tables to be transformed. Only tables that do not currently implement entities can be selected.

Entity Name

Mandatory, 30 character
The name of the entity definition to be created. This field defaults to the table name with any underscore characters present in the name replaced with spaces. If the wording is not acceptable, you can type over this entry.

Entity Short Name

Mandatory, 10 character
The short name of the entity definition to be created. This field defaults to the table name. If the wording is not acceptable, you can type over this entry.

Entity Plural

Mandatory, 100 character
The name of the entity plural to be created. This field defaults to the table name with any underscore characters present in the name replaced with spaces. If the wording is not acceptable, you can type over this entry.

Update relationships for existing entities

With this box checked, the utility will create relationships for foreign keys that have been added to tables that implement existing entities.

Update unique identifiers for existing entities

With this box checked, the utility will create unique identifiers for primary and unique key constraints that have been added to tables that implement existing entities. Also, the utility will replace attribute unique identifier entries with relationship entries or create new relationship entries, where the primary or unique key implementing the unique identifier shares columns with a foreign key of the table.

Candidate Tables button

Displays a Candidate Tables dialog box listing all the tables in the current application system that can be transformed into entities. Tables previously used to implement entities are not displayed in the list. A Filter field is available to locate specific tables in the list.

Retrofit button

Transforms the table definitions displayed in the Table to Entity Retrofit dialog into entity definitions.

Grid Save button

Saves the current widths of grid columns.

Grid Reset button

Resets grid columns to their default widths.


Candidate Tables dialog box

Related Topics

This dialog lists all the tables in the current application system that can be transformed into entities. A Filter field is available to locate specific tables in the list. Choose the tables you require and press OK.