Powerdesigner generates COMMENT for mysqlPDM _ MySQL

Source: Internet
Author: User
Tags powerdesigner
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.