PowerDesigner 反向生成 pdm 相关操作

依稀记得在学校的时候,当需要对数据库中的表进行统计时,傻傻的用word一个个编辑,效率极其低下,这里主要记录下 使用 PowerDesigner 反向生成 数据库表记录 即 物理数据模型(pdm)的一些步骤

1. 连接远程数据源

https://app.yinxiang.com/fx/857875fd-e209-4a61-827a-914c52ae6d2d

  1. 若是报找不到 mysql 连接包
  1. 将 mysql.jar 驱动包 复制到 powerDesigner 的安装根目录下;
  2. 关闭powerDesigner 重新打开即可;

2. 反向生成PDM

https://app.yinxiang.com/fx/7963ad68-3702-4373-a51e-1b626ea871ba

2.1 显示comment 到name的方式

在pdm视图下,ctrl+shift+x 调出执行脚本界面,然后执行

Option   Explicit 
ValidationMode   =   True 
InteractiveMode   =   im_Batch
 
Dim   mdl   '   the   current   model
'   get   the   current   active   model 
Set   mdl   =   ActiveModel 
If   (mdl   Is   Nothing)   Then 
      MsgBox   "There   is   no   current   Model " 
ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
      MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
Else 
      ProcessFolder   mdl 
End   If
Private   sub   ProcessFolder(folder) 
On Error Resume Next
      Dim   Tab   'running     table 
      for   each   Tab   in   folder.tables 
            if   not   tab.isShortcut   then 
                  tab.name   =   tab.comment
                  Dim   col   '   running   column 
                  for   each   col   in   tab.columns 
                  if col.comment="" then
                  else
                        col.name=   col.comment 
                  end if
                  next 
            end   if 
      next
      Dim   view   'running   view 
      for   each   view   in   folder.Views 
            if   not   view.isShortcut   then 
                  view.name   =   view.comment 
            end   if 
      next
 
      '   go   into   the   sub-packages 
      Dim   f   '   running   folder 
      For   Each   f   In   folder.Packages 
            if   not   f.IsShortcut   then 
                  ProcessFolder   f 
            end   if 
      Next 
end   sub

2.2 修改pdm视图下的内容

  1. 先执行上面2.1中命令
  2. 点击 Tools - Display Preferences - Table - Content -Advanced(右下角)-Colums - List cloums 中选择需要展示的东西

3. 报表

3.1 新建报表模板

  1. 最上标签栏 Report - Report Templates - 左上图标 new - 选择语言为 简单中文 - Type 为 Physical Data Model - ok
  2. 编辑模板

3.2 修改报表模板中一些中文术语的定义

即文件:C:\Program Files\Sybase\PowerDesigner Trial 11\Resource Files\Report Languages\Chinese.xrl

  1. Tools-Resources-Report Languages-选择Chinese-单击Properties或双击目标
  2. 修改某些对象的名称:Object Attributes\Physical Data Model\Column
    ForeignKey:外键
    Mandatory:为空
    Primary:主键
    Table:表用查找替换,把“表格”替换成“表”
    修改显示的内容为别的:Values Mapping\Lists\Standard,添加TRUE的转化列为是,FALSE的转化列为否
    另外 Report-Title Page里可以设置标题信息

记得修改完点击保存

3.3 生成报表

  1. Report - Generate Report
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值