Switch to standard view 
  Sybase logo
 
 
 



How to set up PowerDesigner to allow multiple Entity Attributes with the same Name and Code

The Model Options in PowerDesigner exist to allow you, the user, to change the default behavior of the product. In the CDM, the default behavior when adding new data items/attributes is to require the use of Unique Codes. Unique codes mean that the code value used can be used with one and only one data item/attribute in the current CDM.

In order to change this default behavior, you must modify the Model Options. In the Model Options, there are several different combination of the Data Item options that will provide different behavior when adding data items to entities.

To modify the Model Options, do the following:

1) Open a CDM
2) From the File menu, select Model Options
3) In the Model Options window goto the Data Item section

<<Screen shot of default Model Options>>

Besides the default Data Item option setting, there are four additional combination of options that can be selected.

Combination 1
This combination results with a new data item being created and does not allow attributes marked as identifiers to be used in more than one entity.

In the Model Options window, select Unique code, Allow reuse and Duplicate. Click <OK>.


Now in the CDM when you add a data item with the same code value to multiple entities, a new data item will be created by appending a numerical value at the end of the name and code of the data item. Thus in the following example, data item 'abc' is first added to ent_1. When data item 'abc' is added to ent_2, it is duplicated and becomes data item 'abc2'. NOTE: If the attribute, abc, was an Identifier in ent_1, then it would not be available to be added to other entities. This is a result of 'Unique Code' being selected.




Combination 2
This combination results with a data item being reused/ associated to multiple entities and does not allow attributes marked as identifiers to be used in more than one entity.

In the Model Options window, select Unique code, Allow reuse and Reuse. Click <OK>.


Now in the CDM when you add a data item with the same code value to multiple entities, the data item will be associated with each entity. Thus in the following example, data item 'abc' is first added to ent_1. When data item 'abc' is added to ent_2, it is added as attribute 'abc'. NOTE: If the attribute, abc, was an Identifier in ent_1, then it would not be available to be added to other entities. This is a result of 'Unique Code' being selected.



Combination 3
This combination results with a new data item being created and does allow attributes marked as identifiers to be used in more than one entity.

In the Model Options window, select Allow reuse and Duplicate. Click <OK>.


Now in the CDM when you add a data item with the same code value to multiple entities, a new data item will be created with the same name and code value. The only difference is the entity that the data item is associated with. Thus in the following example, data item 'abc' is first added to ent_1. When data item 'abc' is added to ent_2, it is duplicated as data item 'abc'. NOTE: All data items including those marked as Identifiers are available to be added to multiple entities. This is a result of 'Unique Code' being deselected.




Combination 4
This combination results with a data item being reused/ associated to multiple entities and does allow attributes marked as identifiers to be used in more than one entity.

In the Model Options window, select Allow reuse and Reuse. Click <OK>.


Now in the CDM when you add a data item with the same code value to multiple entities, the data item will be associated with each entity. Thus in the following example, data item 'abc' is first added to ent_1. When data item 'abc' is added to ent_2, it is added as attribute 'abc'. NOTE: All data items including those marked as Identifiers are available to be added to multiple entities. This is a result of 'Unique Code' being deselected.




Back to Top
© Copyright 2010, Sybase Inc.