Associations and aggregations represent a relationship between two classes. If one class owns another class, then it's an aggregation. (Attribute has a Domain, Entity is owned by Model and Model has a list or collection of Entities etc.)
To create Associations / Aggregations
- Click on the toolbar.
- Move your mouse cursor over the work area.
- Click the first class and then the target class.
Double-click the association line on the Workspace.
or
Edit the association in the Associations dialog (Model menu | Model Items |Associations).
General Tab |
Description |
Name |
Name of the association/aggregation |
Advanced Tab |
Description |
Role |
Name of property that will be added to class |
Aggregation |
Represents an owner of the second class. |
Many |
Property created in the second class will not be of the Dispatch type but the List type, and will work as a collection. |
External |
External associations create new properties in the selected class. Uncheck the External checkbox not to create the properties. In both cases, a relationship with information about linkages is created. |
Attributes1, Attributes2 Tab |
Represent attributes that can be assigned to classes on both sides of the association or aggregation. Names of properties are defined on tab Advanced in the Role box. Every attribute may change class behavior.
A list of attributes is accessible via Model menu | Attributes. |
Features and Tools > About Templates
Toad Data Modeler allows you to:
- Use pre-defined templates for properties that contain SQL code in your model (SQL, Before Script, After Script etc.).
- Create your own user templates for these properties.
- Set a default template for each property.
- Import Toad for Oracle templates.
Example: You have created an entity trigger. Edit it and see the SQL tab in the Trigger Properties dialog. The SQL code has been pre-defined = particular default template has been used (according to the database). You don’t have to write the code manually for every new created trigger.
To select another than default template in object Properties dialog
Press CTRL+A to highlight all text in the text box and select another template from the Templates box.
|
Note: To replace one template with another, all text should be selected. Otherwise, the new template selected from the Templates box will be inserted to the position of cursor in the box. This behavior allows you to put together partial templates. |
Templates |
Shows all active templates for this object. |
|
Inserts the selected template. |
|
Opens the Template Editor. |
All templates are available in Template Editor.
|
Note: Templates for Properties with SQL Code - To find out for which properties you can create the templates, see the Reference Guide and search the Supports Templates attribute. |
To open Template Editor
Select Settings | Templates.
To display templates for particular database or database version
- From the Model Type box, select the database or particular database version.
- Click Load Templates.
|
Note: This option is available only if packages with the templates for selected database haven’t been loaded so far. |
Commit |
Confirms changes made in the Template Editor and saves them to particular packages.
|
Note: Packages are not saved to your hard disk. | |
Commit and Save |
Confirms changes made in the Template Editor and saves them to particular packages (.txg files). The packages are saved to your hard disk. |
Rollback |
Cancels changes made in Template Editor. |
Import Toad for Oracle Templates |
Imports templates from Toad for Oracle to the Toad Data Modeler Template Editor.
|
Note: This option is available only if you have Toad for Oracle installed on your computer. | |
Model Type |
Select a database or particular database version for which you want to display the templates.
|
TIP: Feel free to open Templates Editor for different database platforms or versions, dock the windows, compare the templates. | |
|
Creates a new template. |
|
Deletes the selected template. Click Commit to confirm the deletion. |
|
Opens the Template Properties dialog. |
Object Category |
List of objects (entities, attributes, triggers, check constraints, views, procedures etc.) with list of available SQL properties (SQL, Before Script , After Script etc.). |
Parent |
Information on parent object |
Template Name |
Specify any name for your template to distinguish it from others. |
Default |
Select this checkbox to set the template as default. The template will be pre-defined in the object Properties dialog. |
Active |
Select this checkbox to display the template in the Templates box in the object Properties dialog.
|
Template |
Provides a quick view on the body of the SQL code. |
Template body for template |
Write the SQL code to this window.
|
Note: Remember to save the changes Commit or Commit and Save. | |
Available Pre-defined Templates
There are two pre-defined templates – Body and Complete. Both relate to the Generate SQL Only checkbox on tab General of object Properties dialog.
- Body – The Generate SQL Only checkbox is deselected.
Example of default code for trigger:
BEGIN
/*trigger_body*/
END
- Complete – The Generate SQL Only checkbox is selected. (It means that settings on tab General are ignored in final SQL code.)
Example of default code for trigger:
CREATE OR REPLACE TRIGGER <%<%FullName%>%>
AFTER /*BEFORE*/
INSERT /*UPDATE | DELETE*/
ON <%<%TableFullName%>%>
BEGIN
/*trigger_body*/
END
To set this property for your user templates, see the Template Properties dialog, General tab and select or clear the Generate SQL Only checkbox.
Where Templates Are Stored
All pre-defined templates are saved in the Templates.txg file that is copied among user packages during first start-up of Toad Data Modeler.
All user templates are by default saved to My Package.txg.
Both files are stored among user packages at (default location):
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation name\Packages\{GUI}
Why are pre-defined templates stored in another package? - Once our team brings new pre-defined templates, you will be able to replace the old pre-defined templates with the new ones (Templates.txg). Your user templates will stay preserved in your My Package.txg.
We do NOT recommend to modify the pre-defined templates. If you do so, please remember to save the template to My Package.txg (see the Template Properties dialog, General tab, Package area.)