Chapter 9 Working with Data Models


Generating Other Models from a PDM

The following table details how PDM objects are generated to other models:

PDM CDM LDM OOM XSM
Domain Domain   Domain Simple Type
Table Entity   Class Element
Table column Entity attribute   Attribute Attribute or element
Primary key Primary identifier   Primary identifier -
Alternate key Identifier   Identifier -
Foreign key -   - Keyref constraint
Stored-Procedures -   Operation -
View -   - Element
View column -   - Attribute
Index -   - Unique
Abstract data type -   - Complex type
Reference Relationship   Association -

Note   XML model naming conventions
If the code of the generated XML model objects does not correspond to the target language naming conventions, you can define a code naming convention script to convert object names into codes.
For more information on conversion scripts, see ".convert_name & .convert_code macros" in the Models chapter.

XML Specifics

Generation of column as attribute or element is controlled by generation option

Foreign keys - When a foreign key is not a composition, it is generated as a KeyRef constraint

Oracle 8 and Interbase sequence translation

When a CDM is generated from a PDM, the data type of a table column attached to a sequence is translated to a serial data type in the new model.

The resulting CDM serial data type for an entity property has the format NO%n , where %n is a number indicating the length of the data type.

For more information on sequences, see sections on Oracle and Interbase in chapter DBMS-specific Features.

OOM Specifics

All tables are generated as persistent classes with the "Generate table" persistence mode.

All abstract data types are generated as persistent classes with the "Generate ADT" persistence mode.

Table - Class. The cardinality of a class is translated from the number of estimated records in a table

Table with migrated keys from only two other tables - Class linked with an association class between the two classes generated by the two parent tables

Stored-Procedures and stored functions attached to selected table - If the parent table is generated as a class, the stored procedure or the stored function is generated as an operation attached to the class

Note   OOM naming conventions
If the code of the generated OOM objects does not correspond to the target language naming conventions, you can define a code naming convention script to convert object names into codes. For more information on conversion scripts, see ".convert_name & .convert_code macros" in the Models chapter.

 


Copyright (C) 2008. Sybase Inc. All rights reserved.