zoukankan      html  css  js  c++  java
  • powerdesigner 生成mysql PDM 的COMMENT注释

    powerdesigner 生成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

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

  • 相关阅读:
    1、搭建CICD平台
    Jackson 的 基本用法
    多种方式实现动态替换Android默认桌面Launcher
    Springboot2.x整合Redis以及连接哨兵模式/集群模式
    Redis哨兵(Sentinel)模式
    redis的哨兵模式(redis有密码)
    【数据结构】——LCT(link cut tree)
    征战蓝桥 —— 2017年第八届 —— C/C++A组第3题——魔方状态
    征战蓝桥 —— 2017年第八届 —— C/C++A组第4题——方格分割
    征战蓝桥 —— 2017年第八届 —— C/C++A组第4题——方格分割
  • 原文地址:https://www.cnblogs.com/yangy608/p/1941477.html
Copyright © 2011-2022 走看看