PowerDesigner generating comment annotations for MySQL PDM
The default PD does not generate comments and can be modified as follows for mysql5.0.
At the Database-->edit current DBMS ...
Set the properties of the DBMS to find the 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%]]
Switch
%20:column% [%national%?national]%datatype%[%unsigned% unsigned][%zerofill%? zerofill][[. O:[character Set][charset]]%charset%][. z:[%notnull%][%identity% auto_increment:[default%default%]][comment%.q:comment%]]
Oh, in fact, only the last objtlabl changed to comment on the line. Before the objtlabl don't know what to refer to, know the friend tell ...
The generated code has a comment for each field:
CREATE TABLE Code
(
CODE_ID INTEGER NOT NULL comment ' code ID ',
Code_no VARCHAR (TEN) not null comment ' code encoding ',
Code_chinese_name VARCHAR () Not null comment ' Chinese name ',
Code_english VARCHAR (a) Comment ' English name ',
parent_code_id INTEGER Comment ' Parent code ID ',
Code_type VARCHAR (Comment ' code type '),
Sort_no INTEGER Comment ' Code number ',
create_by INTEGER comment ' record creator ',
Create_date TIMESTAMP comment ' record creation time ',
update_by INTEGER comment ' record update person ',
Update_date TIMESTAMP comment ' record update time ',
Primary KEY (CODE_ID)
);
Notes for the table:
To set the properties of the DBMS, locate mysql5.0-->script-->objects-->table-->tablecomment:
Value, add the following:
ALTER TABLE [%qualifier%]%table% comment%.60qa:comment%
When added, the following statement is generated:
ALTER TABLE code comment ' Codes table ';
Code generation:
Click menu Database-->generate Database
The Database Generation screen appears: In the Format tab, tick generate name in empty comment
Click OK to generate the appropriate code, and the comments above will appear in the code.
PowerDesigner generating comment annotations for MySQL PDM