When PowerDesigner designs a table, the comment column Comment is displayed

First, use PowerDesigner to create a new model, File —> New Model
insert image description here

Then, switch to the Model types tab and check Physical Diagram

picture.png

Then click the table icon on the right to create a table in the left panel as follows. Double-click the table, find the Columns tab, and add column fields to the database table

picture.png

As shown in the figure, the created table does not have a Comment description field by default

picture.png

Double-click on the table to be edited to open the Table Properties window and switch the upper tab to Columns

picture.png

Click the Customize Columns and Filter button, the button in the red box below, or press the Ctrl+U shortcut key. In the opened Customize Columns and Filter window, tick the check box in front of Comment

picture.png

At this point, you can see the Comment in the Columns tab page of the Table Properties window

picture.png

However, after saving and returning to the design view, there is still no comment information, which is very inconvenient for us to design

picture.png

Find Model->Extensions in the toolbar, as shown below

picture.png

In the opened List of Extensions dialog box, create a new one, and then click the "Properties" button

picture.png

Right click on Profile and click Add Metaclasses

picture.png

Select Column, then click OK

picture.png

Select Column, right click and select New->Extended Attribute

picture.png

Name a name (such as zhComment), select String for dataType, select Computer, Read only

Note: Comment cannot be used for the name, because this is a built-in name, and if you use it, you will be prompted to duplicate the name

picture.png

Switch to the Get Method Script tab and %Get% = ""change to%Get% = Rtf2Ascii (obj.Comment)

picture.png

picture.png

Confirm to save, return to the view interface, find Tools->Display Preferences in the toolbar

picture.png

Click Table->Advanced in turn

picture.png

Select columns, then click the Select button on the right side of List Columns

picture.png

Find the attribute set earlier, check it and save it

picture.png

Back to the view interface, the table can already display the Comment field

picture.png

Guess you like

Origin blog.csdn.net/chy555chy/article/details/128706645