You can customize the generation of your models by selecting model generation options.
The General tab lets you specify the new model to be generated or existing model to be updated.When generating a new model, you must specify the following options:
Option |
Description |
---|---|
DBMS, Object, XML, or Process language |
Specifies the definition file for the model to be generated. By default, PowerDesigner creates a link to this file. To copy the definition and save it in your model file, click the Embed Resource in Model button. |
Name / Code |
Specifies the name and code for the model to be generated. Click the Configure Model Options button to specify naming conventions (see Naming Conventions) and other model options for the model to be generated. |
When updating an existing model, you must specify the following options:
Option |
Description |
---|---|
Select model |
Specifies the target model to be updated. Select a model that has already been generated from the current model from the list, or click the ellipsis button to the right to open a list of other models of the same type open in the workspace. |
DBMS, Object, XML, or Process language |
Displays the definition file of the model to be updated. |
Preserve modifications |
Allows you to review the changes to be made to the model (see Comparing and Merging Models). If this option is not selected, generated objects will replace objects with the same name in the model. |
The Detail tab contains options to control the generation of model objects.
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 Checking Models). (see |
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 (see The Generation Links Viewer). |
Generate Mappings |
Defines the source model as the data source of the generated model and creates mappings between all source and target objects (see Object Mappings). This option is dependent on the Save Generation Dependencies option. |
Rebuild Triggers |
[CDM/OOM-PDM] Instructs PowerDesigner to rebuild triggers with unmodified templates after the PDM generation. |
Convert Names into Codes |
Instructs PowerDesigner to generate target model object codes using a conversion script. 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, generate an OOM Java class attribute with a code of customerName to a PDM table column called CUSTOMER_NAME by clicking the Configure Model Options button on the General tab, selecting the appropriate conversion script (see Name and Code Conversion Scripts), and selecting this option. |
Preserve n-n relationships |
[CDM-LDM only] Specifies that many-to-many relationships created in the CDM will be generated to the LDM if the destination model permits them. |
Enable transformations |
Displays the Extensions tab, the Pre-generation tab (if your model has transformations defined) and the Post-generation tab (if you are updating an existing model that has transformations defined) to select transformations to perform before and/or after generation (see Applying Pre- and Post- Generation Transformations). |
Skip single root element |
[XSM-PDM only] Specifies that the single root element is ignored, and its immediate child elements are treated as multiple roots, which will be generated as tables. |
Generate root element |
[PDM/OOM-XSM only] Specifies that a single root element representing the PDM or OOM model is generated. Deselecting this option means that all the tables or classes are generated as multiple roots. |
Generate tables/classes as |
[PDM/OOM-XSM only] Specifies how PDM tables or
OOM classes are generated. You can choose between:
|
Generate columns/attributes as |
[PDM/OOM-XSM only] Specifies how PDM columns or OOM attributes
are generated. You can choose between:
|
Class Prefix |
[OOM only] Specifies a prefix to apply to the codes for all classes generated. |
The following additional options are available when generating a PDM:
Option |
Description |
---|---|
Table: Table Prefix |
Specifies a prefix for the names of generated tables. |
Table: 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 |
Index: PK index names |
Specifies the naming convention for primary keys. You can use the following variables in this and the Key index fields:
Default: %TABLE%_PK |
Index: AK index names |
Specifies the naming convention for alternate keys. You can use the following variables in this field:
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 |
Index: FK index names |
Specifies the naming convention for foreign keys, by default %REFR%_FK |
Index: 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. |
Reference: Update Rule |
Specifies the default update constraint for referential integrity. |
Reference: Delete Rule |
Specifies the default delete constraint for referential integrity. |
Reference: 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:
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 Customizing and Extending PowerDesigner > DBMS Definition Files. |
Reference: Use template |
Controls when the FK column name template will be used. You can choose between the following radio buttons:
|
When you reverse engineer a database into a PDM and then generate an OOM, you can add an appropriate package hierarchy in the OOM by right-clicking the OOM in the Browser, selecting Add Package Hierarchy, and entering an appropriate hierarchy (for example, com.mycompany.myproduct.oom).
This tab contains a list of target models referenced by shortcuts or replications in the current model, and the appropriate generated models that the generated model will reference (see Generating Shortcuts and Replicas). If any target model does not have a generated model listed, the generation of shortcuts or replications referencing it will fail. This tab will be empty if your model does not contain shortcuts to other models or if these shortcuts are set to generate as independent objects.