Document directory
- Powerdesigner generates comment comments for MySQL PDM
Powerdesigner generates comment comments for MySQL PDM
No comments are generated for the default PD, which can be modified as follows for MySQL.
In database --> edit current DBMS...
Set the DBMS attributes and find mysql5.0 --> script --> objects --> column --> Add
Put the original content:
% 20: column % [% National %? National] % datatype % [% unsigned %? Unsigned] [% zerofill %? Zerofill] [[. O: [character set] [charset] % charset %] [. Z: [% notnull %] [% identity %? Auto_increment: [Default % default %] [comment %. Q: @ objtlabl %]
Changed:
% 20: column % [% National %? National] % datatype % [% unsigned %? Unsigned] [% zerofill %? Zerofill] [[. O: [character set] [charset] % charset %] [. Z: [% notnull %] [% identity %? Auto_increment: [Default % default %] [comment %. Q: Comment %]
In fact, only the final objtlabl can be changed to comment. In the past, objtlabl did not know what it meant. If you knew it, please let me know...
In this way, every field of the generated code is annotated:
Create Table Code
(
Code_id integer not null comment 'Code id ',
Code_no varchar (10) Not null comment 'Code encoding ',
Code_chinese_name varchar (50) not null comment 'Chinese name ',
Code_english varchar (50) Comment 'English name ',
Parent_code_id integer comment 'parent code id ',
Code_type varchar (50) Comment 'Code type ',
Sort_no integer comment 'Code sequence number ',
Create_by integer comment 'record creator ',
Create_date timestamp comment 'record creation time ',
Update_by integer comment 'record updater ',
Update_date timestamp comment 'record update time ',
Primary Key (code_id)
);
Table comment:
Set the DBMS attributes and find mysql5.0 --> script --> objects --> table --> tablecomment:
Add the following content in value:
Alter table [% qualifier %] % table % comment %. 60qa: Comment %
The following statement is generated after the addition:
Alter table code comment 'Code table ';
Code Generation:
Click database --> Generate Database
The database generation screen is displayed. On the format tab page, select generate name in empty comment.
Click OK to generate the corresponding code, and the above comments will appear in the code.