Model Generation Options Window Detail Tab

The following options are available on this tab:

Option

Description

Check Model

Invokes a model check before generation, and stops generation if errors are found. You can configure specific model checks before generation by selecting Tools > Check Model. For more information, see Checking a Model.

Save Generation Dependencies

Instructs PowerDesigner to retain links between each source object and the corresponding target object, which allow objects to be subsequently identified, even if they have been modified.

Generate Mappings

Defines the source model as the data source of the generated model and creates mappings between all source and target objects. This option is dependent on the Save Generation Dependencies option.

Rebuild Triggers

[CDM-PDM and OOM-PDM only] Instructs PowerDesigner to build triggers with preservation option, after the PDM generation. Rebuild takes place after merge if you are updating an existing PDM

Convert Names into Codes

Instructs PowerDesigner to generate target model object codes from source model object names using the appropriate conversion script (see Name and Code Conversion Scripts). This option can be useful when generating models with very different naming conventions. If it is not selected, target object codes are generated from source object codes.

For example an OOM Java class attribute code may be customerName whereas the PDM table column that you want to generate must be called CUSTOMER_NAME. By selecting this option and specifying the appropriate conversion scripts in the model options available from the General tab, you can generate your columns with appropriate codes.

Enable transformations

Enables pre- and post-generation transformations.

When you click this button, the Pre-generation tab is displayed if the source model contains transformations. You can select the transformations to execute before generation.

The Extended Model Definitions tab also is displayed for you to select extended model definition files to attach to the generated model. These files may contain post-generation transformations, in this case, the Post-Generation tab is displayed to let you select the transformations you want to be executed in the generated model. If the generation is an update, and the generated model contains extended model definitions with post-generation transformations, the Post-generation tab is automatically displayed as soon as you click the Enable Transformations button.

Skip single root element

[XSM-PDM only] Specifies to ignore a single root element and to treat its immediate child elements as multiple roots, which will be generated as tables.

Generate columns/attributes as elements

[PDM-XSM only], Specifies that PDM table columns are generated as child elements (instead of attributes) in the XML model. You can then set attributes to these child elements.

Class Prefix

Prefix for a class. It can help identify a class in a model

Table Options

The following options are available when generating a PDM:

Option

Description

Table Prefix

Specifies a prefix for the names of generated tables.

ID column type

[XSM-PDM only] Specifies the type to use for ID columns, and which will be used to generate xs:ID types.

Default: numeric

Reference Options

The following options are available when generating a PDM:

Option

Description

Update Rule

Specifies the default update constraint for referential integrity.

Delete Rule

Specifies the default delete constraint for referential integrity.

FK column name template

Specifies the naming convention for migrated foreign keys. You can select one of the default templates from the list or enter your own using the following variables:


  • %REFR% - Name / Code of the reference

  • %PARENT% - Name / Code of the parent table

  • %COLUMN% - Name / Code of the parent column

  • %KEY% or %CONSTNAME% - Name / Code of the key constraint attached to the reference

  • %PROLE% - Role of the entity that generated the parent table, this variable proceeds from the conceptual environment. If no role is defined on the relationship or association, %PROLE% takes the content of %PARENT% to avoid generating a column with no name

The following example checks the %PROLE% value; if it is equal to the parent name (which is the replacement value) then the template "%.3:PARENT%_%COLUMN%" will be used, otherwise template "%PROLE%" will be used because the user has entered a parent role for the relationship:

[%PROLE%=%PARENT%?%.3:PARENT%_%COLUMN%:%PROLE%]

Customized naming templates reappear in the generation dialog box the next time you open it, but are not saved to the list of predefined templates.

For more information about PowerDesigner variables, see "PDM Variables" in the DBMS Resource File Reference chapter of the Customizing and Extending PowerDesigner manual

Use template

Controls when the FK column name template will be used. You can choose between the following radio buttons:


  • Always use template

  • Only use template in case of conflict

Index Options

The following options are available when generating a PDM:

Option

Description

PK index names

Specifies the naming convention for primary keys. You can use the following variables in this and the Key index fields:


  • %TABLE% - Generated code of the table. This is the table code that is generated in the database. It may or may not be truncated if the code contains characters not supported by the DBMS

  • %TNAME% - Table name

  • %TCODE% - Table code

  • %TLABL% - Table comment

Default: %TABLE%_PK

AK index names

Specifies the naming convention for alternate keys. You can use the following variables in this field:


  • %REFR% - Generated code of the reference

  • %REFNAME% - Reference name

  • %REFRCODE%- Reference code

  • %PARENT% - Generated code of the parent table

  • %PNAME% - Parent table name

  • %PCODE% - Parent table code

  • %CHILD% - Generated code of the child

  • %CNAME% - Child table name

  • %CCODE% - Child table code

  • %PQUALIFIER% - Parent table qualifier

  • %CQUALIFIER% - Child table qualifier

The generated code of a variable is the code defined in the object property sheet, which may be truncated when generated if the code contains characters not supported by the DBMS

Default: %TABLE%_AK

FK index names

Specifies the naming convention for foreign keys, by default %REFR%_FK

FK threshold

Specifies the minimum number of estimated occurrences of an entity necessary to create an index on a foreign key. The estimated number of occurrences can be specified in the entity property sheet. If this property is not set, foreign key indexes are generated by default.

Note:

If you modify a primary key in a PDM, then regenerate the PDM from a CDM, the modified primary key is not preserved. If you want to preserve a modified primary key, you need to modify the identifier in the CDM before regeneration.

Add Package Hierarchy

When you reverse engineer a database into a PDM and then generate an OOM with the corresponding O/R mapping, you can use the Add Package Hierarchy feature to create the appropriate packages in the OOM. You select the Add Package Hierarchy command from the object model contextual menu. For more information, see the Generating and Reverse Engineering OO Source Files chapter in Object-Oriented Modeling.