2. When you are finished modifying the relational model, reverse engineer the changes to the logical model by clicking the pane for the relational model and
1.5 Data Modeler Options (User Preferences)
You can customize many aspects of SQL Developer Data Modeler by clicking Tools, then General Options.
Many preferences are self-explanatory, and this topic explains only those whose meaning and implications are not obvious. The preferences are grouped in the following categories: ■ General ■ Model ■ Diagram ■ Naming Standard ■ DDL
■ Third Party JDBC Drivers
1.5.1 General
The General pane contains options that affect the startup and overall behavior and appearance of SQL Developer Data Modeler.
Default Designs Directory: The default directory or folder from which to open a design or in which to create a design.
Default Import Directory: The default directory or folder from which to import designs.
Show Log After Import: Controls whether a Log window is displayed after an import operation. The window contains informational messages and any warning or error messages.
Show "Select Relational Models" Dialog: Controls whether the dialog box for
selecting relational models to be included is displayed when you open a Data Modeler design. If this option is disabled, all relational models are included by default when you open a Data Modeler design.
Show Properties Dialog on New Object: Controls whether the Properties dialog box for objects of that type is displayed when you create a new model object.
1.5.2 Model
The Model pane contains options that apply to several types of models.
Default RDBMS Type: Default database type.
Default RDBMS Site: Default site within the default database type.
Columns and Attributes Defaults: Nulls Allowed: Controls whether new columns and attributes are allowed to have null values. If this option is disabled, new columns and attributes are by default mandatory (value required).
Model: Logical
Contains options that apply to the logical model.
Relation Cardinality: Source Optional: Controls whether the source entity in a relationship must, by default, contain one or more instances. If this option is enabled, source instances are not required for all relationship types; if this option is disabled, one or more source instances are required for all relationship types.
Relation Cardinality: Target Optional: Controls whether the target entity in a relationship must, by default, contain one or more instances. If this option is enabled, target instances are not required for all relationship types; if this option is disabled, one or more target instances are required for all relationship types.
Use and Set First Unique Identifier as Primary Key: Controls whether, by default, the first unique identifier attribute is set as the primary unique identifier when you create an entity.
Foreign UID Attribute Name Synchronization: Keep as the Name of the Originating Attribute: Controls whether the supertype or referenced attribute must be used in foreign unique identifier naming. To be able to specify some other name, deselect this option.
Model: Relational
Contains options that apply to a relational model.
Delete FK Columns Strategy: Specifies what Data Modeler should do when you attempt to delete a table that has one or more generated foreign key columns (columns in other tables) pointing to it: delete the foreign key columns, do not delete the foreign key columns, or ask to confirm the foreign key column deletions.
For example, using the relational model in Chapter 2, "Tutorial: Data Modeling for a Small Database", if you delete the Books table, the Transactions table contains the book_id foreign key column that refers to the primary key of the Books table. Your choice for this option determines what happens to the Transactions.book_id column if you delete the Books table.
Default Foreign Key Delete Rule: Specifies what happens if a user tries to delete a row containing data that is involved in a foreign key relationship:
■ No Action causes an error message to be displayed indicating that deletion is not
allowed; the deletion is rolled back.
■ Cascade deletes all rows containing data that is involved in the foreign key
relationship.
■ Set Null sets the value to null if all foreign key columns for the table can accept
null values.
Model: Physical
Contains options that apply to a physical model. Different options apply to each supported type of database.
1.5.3 Diagram
The Diagram pane contains general options that affect the appearance of model diagrams.
General: Show Grid: Controls whether a grid is displayed in the background on diagrams. Seeing the grid can help you to align objects vertically and horizontally on the diagram.
General: Synchronize with Tree: Controls whether the focus on an active diagram is automatically moved to reflect the selection of objects under that model in the object browser.
General: Diagram Color: Displays a dialog box for selecting the color scheme for the background on diagrams.
General: Line Auto Route: Controls whether lines representing relations, foreign key relations, inheritances, flows, and other relationships are automatically drawn on diagrams. If you deselect this option, you determine how these lines are drawn; for example, you may want to add or move break points manually, in order to enhance the clarity of your models. For more information about Auto Route and drawing lines, see the explanation of the Auto Route command in Section 1.2.2, "Context Menus".
Process Model: Show Flow Name: Controls whether the flow name is displayed in a box on each flow line in data flow diagrams.
Diagram: Logical Model
Contains options that apply to the diagram of the logical model.
Notation Type: Notation type: Barker (sometimes called "crow’s foot") or Bachman.
Show Source/Target Name: Controls whether the Name on Source and Name on Target values (in the Cardinality pane of the Record Structure Properties dialog box) are displayed. If they are displayed, you can format the text and move the boxes.
Box-in-Box Presentation for Entity Inheritances: Displays subtypes in a box inside their supertype’s box.
Domains Presentation: Specifies what is displayed as the data type for an attribute based on a domain: Domain Name causes the domain name to be displayed; Used Logical Type causes the logical type used in the domain definition to be displayed.
Diagram: Relational Model
Contains options that apply to a diagram of a relational model.
Foreign Key Arrow Direction: Controls whether arrowhead points toward the primary key or the foreign key in foreign key relationship arrows.
Show Foreign Key Name: Controls whether a text box containing the foreign key name is displayed on the foreign key relationship arrow.
Diagram: Classification Types
Specifies colors for the display of different classification types in a multidimensional model.
Diagram: Format
Specifies options for default fonts and colors for objects and default widths and colors for types of lines.
1.5.4 Naming Standard
The Naming Standard pane lets you implement naming standardization: you can view, add, and modify naming standards for logical and relational model objects and for domains. These standards will be checked when you apply Design Rules, and any violations of the standards will be reported as errors or warnings.
Do not confuse naming standardization with using the Name Abbreviations dialog box, which makes immediate name changes to enforce consistency in spellings and abbreviations, and which is limited to relational model name strings.
Logical, Relational, Domains
For logical model entities and attributes, relational model tables and columns, and domains, you can add, rearrange, and make optional or mandatory any of the following components of object names: prime word, class word, modifier, and qualifier. The acceptable values of these components are specified in the glossary file or files that you specify in the Glossary pane.
Title Case (Separator option): Refers to capitalizing each "word" and not including spaces: for example, GovernmentAccounts. (Title case is sometimes called
CamelCase.)
Abbreviated Only: If this option is enabled, non-abbreviated words cannot be used in relational model object names (that is, only abbreviated words can be used).
For explanations of other terms, see Section 3.39, "Glossary Editor". For an excellent discussion of naming standards, see the United States Coast Guard Data Naming Element Standards Guidebook.
Relational - Others
For various kinds of constraints in relational models, you can edit the format string and add variable string elements.
Example: To see a sample name in a currently specified format, select the desired constraint type (for example, Foreign Key).
Glossary
You can add one or more glossary files to be used in naming standardization. (For more information about glossaries, see Section 3.39, "Glossary Editor".)
1.5.5 DDL
The DDL pane contains general options for Data Definition Language (DDL) statements in code to be generated.
Statement Termination Character for DB2 and UDB: Termination character for DDL for IBM DB2 and UDB databases.
Create Type Substitution Triggers for Oracle and UDB: Controls whether triggers are created for type substitutions in Oracle and IBM UDB physical models.
Create Triggers for FK Arc Constraint: Controls whether triggers are created in generated DDL code to implement foreign key arc constraints.
Create Triggers for Non Transferable FK: Controls whether triggers are created for non-transferable foreign key relationships. (Whether a foreign key relationship is transferable is controlled by the Transferable (Updateable) option in the Foreign Key Properties dialog box.)
Show CHAR/BYTE Unit for Oracle Varchar2 and Char Types: Controls whether, for attributes of Oracle type CHAR or VARCHAR2, the unit (CHAR or BYTE) associated with the attribute length is included for columns based on the attribute in relational model diagrams and in generated CREATE TABLE statements.
Use ’Data Type Kind’ Property in Compare Functionality: Controls whether the data type kind (such as domain, logical type, or distinct type) should be considered to
prevent types of different kinds from generating the same native data type (for example, preventing a domain and a logical type from resulting in Number(7,2)).
DDL: DDL/Migration
Lets you specify one or more pairs of string replacements to be made when DDL statements are generated. Each pair specifies the old string and the new string with which to replace the old string.
Selected: Controls whether the specified replacement is enabled or disabled.
Case Sensitive: Controls whether the replacement is done only if the case of the old string in the DDL exactly matches the case specifies for the old string.
1.5.6 Third Party JDBC Drivers
The Third Party JDBC Drivers pane specifies drivers to be used for connections to third-party (non-Oracle) databases. SQL Developer Data Modeler needs to use a JDBC driver for some operations, such as obtaining metadata from the third-party database. Oracle does not supply non-Oracle drivers. To access any non-Oracle databases that require the use of drivers other than ODBC/JDBC (which are included in Java), you must download the files for the necessary drivers, and then add them using this pane. To download drivers, use the appropriate link at the third-party site. For example:
■ For Microsoft SQL Server 2000:
http://www.microsoft.com/downloads/details.aspx?familyid=0728 7B11-0502-461A-B138-2AA54BFDC03A&displaylang=en (Be sure to install all three .jar files: msbase.jar, mssqlserver.jar, and msutil.jar.)
■ For Microsoft SQL Server 2005:
http://www.microsoft.com/downloads/details.aspx?familyid=C470 53EB-3B64-4794-950D-81E1EC91C1BA&displaylang=en
■ For IBM DB2/LUW, the IBM Data Server Driver for JDBC and SQLJ at:
http://www-01.ibm.com/software/data/db2/express/additional-do wnloads.html
For each driver to be added, click the Add (+) icon and select the path for the driver. Third-party databases and their required driver files include:
■ Microsoft SQL Server 2000: msbase.jar, mssqlserver.jar, and msutil.jar ■ Microsoft SQL Server 2005: sqljdbc.jar
■ IBM DB2/UDB: db2jcc.jar