Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Prev | Next |
DDL Transformation
The DDL transformation converts the logical model to any of the supported DBMS structures. The target database type is determined by which DBMS is set as the Default database in the model.and that is ready for DDL generation. The data model can then be used to automatically generate DDL statements to run in one of the system-supported database products.
The DDL transformation uses and demonstrates support in the intermediary language for a number of database-specific concepts.
Concepts
Concept |
Effect |
See also |
---|---|---|
Table |
Mapped one-to-one onto Class elements. 'Many-to-many' relationships are supported by the transformation, creating Join tables. |
|
Column |
Mapped one-to-one onto attributes. |
|
Primary Key |
Lists all the columns involved so that they exist in the Class, and creates a Primary Key Method for them. |
|
Foreign Key |
A special sort of connector, in which the Source and Target sections list all of the columns involved so that:
|
Transform Foreign Keys |
MDG Technology to customize default mappings
DDL transformations that target a new, user defined DBMS require an MDG Technology to map the PIM data types to the new target DBMS.
To do this, create an MDG Technology .xml file named 'UserDBMS Types.xml', replacing UserDBMS with the name of the added DBMS. Place the file in the EA\MDGTechnologies folder. The contents of the MDG Technology file should have this structure:
<MDG.Technology version="1.0">
<Documentation id="UserdataTypes" name="Userdata Types" version="1.0" notes="DB Type mapping for UserDBMS"/>
<CodeModules>
<CodeModule language="Userdata" notes="">
<CodeOptions>
<CodeOption name="DBTypeMapping-bigint">BIGINT</CodeOption>
<CodeOption name="DBTypeMapping-blob">BLOB</CodeOption>
<CodeOption name="DBTypeMapping-boolean">TINYINT</CodeOption>
<CodeOption name="DBTypeMapping-text">CLOB</CodeOption>
...
</CodeOptions>
</CodeModule>
</CodeModules>
</MDG.Technology>
As an example, 'text' is a Common Type (as listed in the 'Database Datatypes' dialog) that maps to a new DBMS's 'CLOB' data type.
Notes
- You can define DBMS-specific aspects not depicted in a Logical model, such as Stored Procedures, Triggers, Views and Check Constraints, after the transformation; see the Physical Data Model topic
Example
The PIM elements
After transformation, become the PSM elements
Generalizations are handled by providing the child element with a Foreign Key to the parent element, as shown. Copy-down inheritance is not supported.