• powerdesigner 生成mysql PDM 的COMMENT注释


    1powerdesigner 生成mysql PDM 的COMMENT注释

    默认的pd没有生成注释,针对mysql5.0可以如下修改。
    在Database-->edit Current DBMS...

    设置dbms的属性,找到mysql5.0-->script-->objects-->column-->add

    把原来的内容:

    %20:COLUMN% [%National%?national ]%DATATYPE%[%Unsigned%? unsigned][%ZeroFill%? zerofill][ [.O:[character set][charset]] %CharSet%][.Z:[ %NOTNULL%][%IDENTITY%? auto_increment:[ default %DEFAULT%]][ comment %.q:@OBJTLABL%]]

    改为:

    %20:COLUMN% [%National%?national ]%DATATYPE%[%Unsigned%? unsigned][%ZeroFill%? zerofill][ [.O:[character set][charset]] %CharSet%][.Z:[ %NOTNULL%][%IDENTITY%? auto_increment:[ default %DEFAULT%]][ comment %.q:COMMENT%]]

    呵呵,其实只有最后的OBJTLABL改为COMMENT就行了。以前的OBJTLABL不知道指什么,知道的朋友告诉一下。。。

    这样生成的代码每个字段就有注释了:

    create table code
    (
       code_id              INTEGER not null comment '代码ID',
       code_no              VARCHAR(10) not null comment '代码编码',
       code_chinese_name    VARCHAR(50) not null comment '中文名称',
       code_english         VARCHAR(50) comment '英文名称',
       parent_code_id       INTEGER comment '父代码ID',
       code_type            VARCHAR(50) comment '代码类型',
       sort_no              INTEGER comment '代码序号',
       create_by            INTEGER comment '记录创建人',
       create_date          TIMESTAMP comment '记录创建时间',
       update_by            INTEGER comment '记录更新人',
       update_date          TIMESTAMP comment '记录更新时间',
       primary key (code_id)
    );
     

    表的注释:

    设置dbms的属性,找到mysql5.0-->script-->objects-->Table-->TableComment:

    value中,增加如下内容

    alter table [%QUALIFIER%]%TABLE% comment %.60qA:COMMENT%

    增加后就会生成下面语句:

    alter table code comment '代码表';

    代码生成:

    点击菜单Database-->generate Database

    出现database generation屏幕:在Format tab页中,勾选generate name in empty comment

    单击确定就可以生成相应的代码,代码中就会出现上面的注释了。

    2 pdm在修改name的时候,code的值将跟着变动,很不方便??

    修改方法:PowerDesign中的选项菜单里修改,在[Tool]-->[General Options]->[Dialog]->[Operating modes]->[Name to Code mirroring],

    这里默认是让名称和代码同步,将前面的复选框去掉就行了。

  • 相关阅读:
    jQuery.messager 使用
    对应后台传json ajax 获取值判断
    easyui datagrid nowrap 使用方法
    easyui combogrid setValues
    去除字符串中所有的逗号
    datagrid loadData 使用方法
    使用git下载一个项目
    java中读取文本文件的时候@Test方法中没有中文乱码,但是@Controller中却有中文乱码
    IDEA启动项目的时候,控制台中显示的都是乱码
    微信流量主点击量与曝光量是什么意思
  • 原文地址:https://www.cnblogs.com/Unrmk-LingXing/p/5200759.html
Copyright © 2020-2023  润新知