Chat now with support
Chat with Support

Toad Data Modeler 7.2 - User Guide

Introduction User Interface Models and Model Objects
Physical Data Model
Entity Relationship Diagram Objects Basic Database Design Advanced Database Design
Universal Data Model Logical Data Model Working with Model Objects
Features and Tools
Application Variables Export/Import DDL Script Generation Graphics Model Actions Print Create New Project Reports Reverse Engineering Scripting and Customization About Templates Tips and Tricks Toad for Oracle Integration Toad Intelligence Central (TIC) Integration Tools Version Control
Options and Configuration Databases
Amazon Redshift 1.0 IBM DB2 LUW 9.5 IBM DB2 LUW 9.7 IBM DB2 LUW 10.1 IBM DB2 LUW 10.5 IBM DB2 LUW 11.1 IBM DB2 z/OS 10 IBM DB2 z/OS 11 Greenplum 4.1 Greenplum 4.2 Ingres 9.3 Ingres 10.0 EDB Postgres Advanced Server 10 Microsoft Access 2007/2010 Microsoft Azure SQL Database V12 Microsoft SQL Server 2005 Microsoft SQL Server 2008 Microsoft SQL Server 2012 Microsoft SQL Server 2014 Microsoft SQL Server 2016 Microsoft SQL Server 2017 Microsoft SQL Server 2019 MySQL 5.0 MySQL 5.1 MySQL 5.5 MySQL 5.6 MySQL 5.7 MySQL 8.0 Oracle 10g Oracle 11g Release 1 Oracle 11g Release 2 Oracle 12c Release 1 Oracle 12c Release 2 Oracle 18c Oracle 19c PostgreSQL 9.0 PostgreSQL 9.1 PostgreSQL 9.2 PostgreSQL 9.3 PostgreSQL 9.4 PostgreSQL 9.5 PostgreSQL 10 PostgreSQL 11 PostgreSQL 12 SQLite 3.7 Sybase ASE 15.5 Sybase ASE 15.7 SAP ASE 16.0 Sybase IQ 15.2 Sybase SQL Anywhere 11 SAP SQL Anywhere 17 Teradata 13 Vertica Database 8.0
Copyright Legal Notices

Select Parent Key for Relationship

Linking Method

In Toad Data Modeler, you can link parent and child entities:

  • Through a Key (Primary or Alternate key) of parent entity
  • Through Unique Index of parent entity

To set a linking method

  1. Double-click the selected relationship.
  2. From the Parent Key box, select the appropriate linking method.

Unique Attributes

Toad Data Modeler creates new alternate keys for unique attributes automatically.

Example: There are two attributes in the T_GENRE entity.

No alternate key exists in this entity.

Edit the Name attribute and select the Unique checkbox.

New alternate key has been added to the entity automatically.

Foreign Keys in Toad Data Modeler

As soon as you create a relationship in Toad Data Modeler, foreign keys are created automatically in the child entity (automatic key migration).

There are two types of foreign keys:

  • Foreign keys (FK, graphically marked by green key by default)
  • Primary Foreign keys (PFK, graphically marked by blue key by default)

The type of FK depends on what relationship you create, see Relationship Types for more information.

 

Synchronization of Not Null and Mandatory Parent

Select Settings | Options | Physical Model | General tab | Synchronize Not Null with Mandatory Parent.

By default, this checkbox is selected. You can change the settings during your modeling, the new setting will be used by default in all new items you create in your model.

  • Synchronization enabled: If cardinality has set Mandatory Parent, a FK attribute will be automatically Not Null. If you clear the Not Null checkbox of the FK attribute, Mandatory Parent option will be unchecked.
  • Synchronization disabled: If you uncheck the Not Null checkbox of a FK attribute, the Mandatory Parent current status remains unchanged.

Foreign Keys in the Attribute Properties Dialog

If you open the Attribute Properties dialog | Foreign Keys tab, you can see details on particular foreign key:

  • Name of the parent entity
  • Name of relationship connecting the parent and child entity
  • Name of PK Attribute

Foreign Keys in the Relationship Properties Dialog

In the Relationship Properties dialog | Foreign Keys tab, you can set a linking method between parent and child entities.

See Select Parent Key for Relationship for more information on available linking methods.

FK Mapping

In Toad Data Modeler, you can control your foreign keys. Foreign keys mapping feature allows you to create Compound Keys, use existing keys etc.

Scenario

In the Genre entity, there is a Genre ID attribute (primary key), and in the Film entity the Genre ID attribute exists too.

If you create a new relationship between the two entities, a new foreign key will be created automatically.

Solution: Map the newly created foreign key:

  1. Double-click the new relationship to edit it.
  2. Click the Genre ID item in the Child column to expand the combo-box with other attributes of the child entity.



  1. Select the first Genre ID item and confirm OK.
  2. Result: There is only one Genre FK in the Film attribute.

TIP: To restore the original foreign key later, go to the Relationship Properties, double-click the genre_id item in Child column and select genre_id (New). This created a new genre_id Foreign Key instead of mapping it to the already existing genre_id attribute.

Automatic FK Mapping

You can also set Automatic FK Mapping in Settings | Options | Model | Physical Model.

  • Disable - FK mapping is OFF
  • Enable - Toad Data Modelersearches for matching attributes. If a single possible mapping option is found, the FK is mapped. If multiple possible mapping options are found, a dialog appears where you choose the attribute the FK should be mapped to.
  • Always Show Dialog - Displays a dialog whenever there is one or more possible mapping options. You get to choose the attribute the FK should be mapped to.

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating