Powerdesigner generates COMMENT comments for mysqlPDM. when using pd, it finds no comments in the generated statement. in this way, you have to manually add these comments. later, I found some methods on the Internet, I did solve the problem. please share it with me.
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 'user' (uid int not null comment 'user ID', username varchar (255) not null comment 'username', password char (32) not null comment 'password ', gid int not null comment 'user group', primary key (uid); alter table 'user' comment 'user table ';
Table comment:
Table comments should be added by default. if not, you can configure the annotations by using the following methods.
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.