PowerDesigner反向生成PDM和name与注释互换

PowerDesigner16 表显示中文字段 1、以管理员身份打开PowerDesigner。备注:需要将空注释的字段补充完整。3、从数据库中逆向数据模型。4、选择MySQL数据源。5、选择配置好的数据连接。6、选择用户所属的表。 阅读详情


原博客地址:http://blog.youkuaiyun.com/linybo/article/details/49329535


工具

PowerDesigner v15.1 汉化破解版 

下载地址   http://download.youkuaiyun.com/detail/javaee1234/9671774


目标:

1: 使用powerdesigner 反向生成PDM.

2: 根据数据库注释,将英文的name替换为commit的汉字内容.

 

使用Powerdesigner的逆向工程生成PDM 
在数据建模过程中,我们建立概念数据模型,通过正向工程生成物理数据模型,生成数据库建库脚本,最后将物理数据模型生成关系数据库。系统数据库设计人员希望能够将数据库设计和关系数据库生成无缝地集成起来,如何保证物理数据模型与其对应数据库之间的双向同步成为数据建模非常关键的一点。 

Powerdesigner作为强大的Case工具,为我们提供了方便的逆向工程特性。可以将目前所有流行的后端数据库(包括Sybase、 DB2、Oracle等)的结构信息通过逆向工程加入到PowerDesigner的物理数据模型和概念数据模型中,包括表、索引、触发器、视图等。 

本文介绍的内容仅涉及PDM(物理数据模型)的逆向工程。 

PDM中的逆向工程是指从现有DBMS的用户数据库或现有数据库SQL脚本中生成PDM的过程。

逆向工程有两种对象:1)通过ODBC数据源连接数据库 2) 现有数据库sql脚本。 

本文示例的系统环境如下: 

1、 数据库已创建完毕,访问用户和密码设置完成。数据库为Oracle9i。 

2、 ODBC数据源已由oracle 的Net Configuration Assistant 创建,本地网络命名服务“Database”。 

3、 sql脚本示例crebas.sql。 

4、 Powerdesigner9.5已安装完成。 


一、 通过数据源连接数据库逆向工程生成PDM 


1、 配置用户数据库连接参数 

选择Database->configure connections,转到system dsn标签, 

点击Add按钮,选数据库类型Oracle,点击完成。显示如下:输入DataSource Name“PDMTest”;输入ServerName“Database”, 配置完成。 

点击“Test Connect”输入ServerName“Database”,用户名和密码,若连接成功,显示如下: 

以后每次连接,选择Database?connect,选择odbc数据源,输入ServerName“Database”,用户名和密码。若无提示,则说明连接成功。同时,可以通过Database?Connection Information 查看连接信息。 

2、 设置逆向工程选项,生成pdm 

创建一个PDM文件,选择与之匹配的数据库类型“oracle9i”。 

选择Database?Reverse Engineer Database,弹出Database Reverse Engineering对话框,选Using an ODBC data source选ODBC数据源“PDMTest” 

点击确定后,显示此数据库中所有表、视图、用户。根据需要选择后,转换成pdm。 

3、 查看数据 

对于生成好的PDM,选择一个表图形符号,点击右键,选择View Data,就可以访问表中的数据了。 

二、 通过SQL脚本逆向工程生成PDM 

1、 数据库SQL脚本文件crebas.sql。下为脚本实例: 
/*==============================================================*/ 
/* Database name: PhysicalDataModel_1 */ 
/* DBMS name: ORACLE Version 9i */ 
/* Created on: 2003-07-13 10:49:08 */ 
/*==============================================================*/ 
/*==============================================================*/ 
/* Table: "class" */ 
/*==============================================================*/ 
create table "class" ( 
"classID" NUMBER(2) not null, 
"className" VARCHAR2(24), 
constraint PK_CLASS primary key ("classID") 
) 
/ 
/*==============================================================*/ 
/* Table: "student" */ 
/*==============================================================*/ 
create table "student" ( 
"studentID" NUMBER(10) not null, 
"studentName" VARCHAR2(4), 
"classID" NUMBER(2), 
constraint PK_STUDENT primary key ("studentID") 
) 
/ 
alter table "student" 
add constraint FK_STUDENT_REFERENCE_CLASS foreign key ("classID") 
references "class" ("classID") 
/ 

2、 创建一个pdm,选择Database?Reverse Engineer Database,选择Using script files。 

3、 看到由脚本自动生成相关的PDM如下所示: 

下面是表名的中文及字段的name和comment的替换问题 

PowerDesigner中name和comment互換 
1 PowerDesigner中批量根据对象的name生成comment的脚本 

执行方法:Open PDM -- Tools -- Execute Commands -- Run Script 

Vb script代码 
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 

'This routine copy name into code for each table, each column and each view 
'of the current folder 
Private sub ProcessFolder(folder) 
Dim Tab 'running table 
for each Tab in folder.tables 
if not tab.isShortcut then 
tab.comment = tab.name 
Dim col 'running column 
for each col in tab.columns 
col.comment= col.name 
next 
end if 
next 

Dim view 'running view 
for each view in folder.Views 
if not view.isShortcut then 
view.comment = view.name 
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 

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 

'This routine copy name into code for each table, each column and each view 
'of the current folder 
Private sub ProcessFolder(folder) 
Dim Tab 'running table 
for each Tab in folder.tables 
if not tab.isShortcut then 
tab.comment = tab.name 
Dim col 'running column 
for each col in tab.columns 
col.comment= col.name 
next 
end if 
next 

Dim view 'running view 
for each view in folder.Views 
if not view.isShortcut then 
view.comment = view.name 
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 PowerDesigner中逆向工程将数据库中comment脚本赋值到PDM的name 

执行方法:Open PDM -- Tools -- Execute Commands -- Run Script 


Vb script代码 
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 

'This routine copy name into code for each table, each column and each view 
'of the current folder 
Private sub ProcessFolder(folder) 

Dim Tab 'running table 
for each Tab in folder.tables 
if not tab.isShortcut then 
if len(tab.comment) <> 0 then 
tab.name = tab.comment 
end if 
On Error Resume Next 
Dim col 'running column 
for each col in tab.columns 
if len(col.comment) <>0 then 
col.name =col.comment 
end if 
On Error Resume Next 
next 
end if 
next 
end sub

Powerdesigner逆向工程生成PDM 中文列名表名 Powerdesigner逆向工程生成PDM 中文列名表名替换为注释 立即下载

相关推荐

你可以看到这个类对属性的存取方法(getter and setter method)使用了标准JavaBean命名约定,同时把类属性(field)的访问级别设成私有的(private)。这是推荐的设计,但并不是必须的。Hibernate也可以直接访问这些field,而使用访问方法(accessor method)的好处是提供了重构时的健壮性(robustness)。为了通过反射机制(Reflection)来实例化\

你可以看到这个类对属性的存取方法(getter and setter method)使用了标准JavaBean命名约定,同时把类属性(field)的访问级别设成私有的(private)。这是推荐的设计,但并不是必须的。Hibernate也可以直接访问这些field,而使用访问方法(accessor method)的好处是提供了重构时的健壮性(robustness)。为了通过反射机制(Reflection)来实例化这个类的对象,我们需要提供一个无参的构造器(no-argument constructor)。

使用PowerDeSigner逆向生成Mysql数据库PDM图(带中文注释)

使用PowerDeSigner逆向生成Mysql数据库ER图(带中文注释)工具选型第一步、生成ER图第二步、 生成中文注释第三步、中英相聚 工具选型 相关资源,点击此处下载,提取码:x3xx。 使用的是15汉化版PowerDesigner mysql驱动选择的是mysql-connector-odbc-5.1.13-win32.msi,必须是32位 Mysql只能是5.*版本,之前试过8.*版本...

zhaogot的博客 5563

PowerDesigner逆向工程时,将表字段的comment转换为PDM的name

在数据库设计中,经常使用数据库逆向工程,将数据库中库表结构转为PDM,为了阅读方便,需要将将表字段的comment转换为PDM的name。该文件解决此问题

PowerDesigner16.5中使用Name生成Comment

生成数据库脚本时,code转换为数据库中表名及字段,如果将将PDM中的name(一般为中文名称)转换为comment,则生成数据库备注栏显示name(中文名称),方便程序员的使用。将name转化为comment,可使用以下脚本批量完成。

yl_sunmoon的专栏 961

Xilinx FPGA 10G Ethernet Subsystem example

The 10G Ethernet subsystem provides 10 Gb/s Ethernet MAC, Physical Coding Sublayer(PCS) and Physical Medium Attachment (PMA) transmit and receive functionality over anAXI4-Stream interface.

青城扬沙的博客 2380

基于C#的机器人控制框架:如何将ROS与硬件集成

本文探讨了如何利用C#与ROS(Robot Operating System)集成开发机器人控制系统。通过ROSSharp库和rosbridge中间件,实现了C#与ROS的WebSocket通信,并展示了硬件控制模块的设计方法。文章详细介绍了电机控制的串口通信实现、ROS消息订阅机制,以及性能优化和容错处理策略,最终构建了一个智能小车控制框架的案例。这种C#与ROS的集成方案为机器人开发提供了跨平台支持,同时兼顾了系统的高效性和可靠性。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1140

脚本解决Powerdesigner逆向工程生成PDM时中文注释问题

为什么80%的码农都做不了架构师?>>> ...

weixin_34218890的博客 308

yolov5 onnx推理时报错[ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Unexpected input data type.

yolov5 onnxruntime 推理报错

zjulkw的博客 1223

PowerDesigner 把Comment写到name中 和把name写到Comment中 pd7以后版本可用

PowerDesigner 把Comment写到name中 和把name写到Comment中 pd7以后版本可用 在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文。Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,

showrock的专栏 896

MACS2软件进行Peak calling

MACS2可以检出ChIP-Seq,ATAC-seq 以及 MeRIP-seq (RNA甲基化测序) 等富集的序列。peaks calling 有不同的方法,MACS2是最常用的call peaks工具。 MACS全称Model-based Analysis of ChIP-Seq,最初的设计是用来鉴定转录因子的结合位点,但是它也可以用于其他类型的富集方式测序。usage: macs2 [-h] [--version] {callpeak,bdgpeakcall,bdgbroadca

qq_27390023的博客 3789

【C2000系列DSP的Bootloader详解】如何利用脚本自动合并Bin文件

本文通过OutconvertBin.py实现了 C2000 Bootloader+UserApp 的「ELF 转 BIN+BIN 合并」全流程自动化,核心优势如下: 架构适配:严格遵循 C28x 16 位大端格式,生成的 BIN 文件可直接烧录; 自动化程度高:一键完成清理、转换、合并,无需手动执行多个命令; 可追溯性:生成 CRC32 校验值,便于验证文件完整性; 量产友好:合并后的merged.bin支持一次性烧录,提升量产效率。

昔时扬尘处 183

PowerDesigner sql生成pdm,pdm的name和注释互换

将sql文件转化成pdm模板 首先数据库生成sql文件,然后打开pdm文件: 打开文件(file)——选中反向工程(reverse Engineer)——数据库(database) 如下图: 然后:选中脚本文件,点击添加已经导出的sql,然后点击确定就可以生成对应的模型。 将pdm的name和注释互换位置 显示效果如图: 操作步骤: Open PDM – Tools – Execut...

1522

【OpenCV】图像的像素直方图 图像特征点 cv::FAST cv::ORB ORB_SLAM2::ORB

文章目录图像直方图代码实现cv::FAST和cv::ORB 检测图像特征点cv::FAST和cv::ORB 检测图像特征点代码实现ORB_SLAM2::ORB和自己实现ORB图像特征点检测效果对比ORB_SLAM2::ORB和自己实现ORB图像特征点检测效果对比代码实现 图像直方图代码实现 图像是由不同数值(颜色)的像素构成的,像素值在图像中的分布情况是图像的重要属性,可以用直方图修改图像的外观,标识图像的内容,检测图像中特定的物体或纹理。 单通道灰度图像中每个像素都有一个 0(黑色)-255(白色)的整

小秋 AI SLAM 入门实战教程 2510

转PowerDesigner反向生成时解决name与注释互换

转地址http://songzj.iteye.com/blog/1172037 执行方法:Open PDM – Tools – Execute Commands – Run Script Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl 'the current model 'get the curre...

weixin_41658204的博客 318

从 Junior 到 Lead:ABAP 开发者进阶路线图与真实项目练级法

本文拆解了ABAP工程师从初级到高级的成长路径,强调能力提升依赖于可复用经验的积累。对于初级开发者,建议夯实ABAP Dictionary、内表处理和数据库思维三大基础,培养数据流与规则层的结构化思维,并逐步掌握面向对象编程。中级阶段应注重代码可维护性,通过单元测试和Clean ABAP规范提升工程质量。文章指出,ABAP开发者需要学会筛选学习重点,建立知识地图,并重视团队协作中的代码可读性。关键在于将碎片知识整合为可迁移的模型,而非盲目追求新技术。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 173

STM32 驱动直流无刷电机(BLDC)发声

STM32 驱动直流无刷电机(BLDC)发声

perseverance51博客 3401

PowerDesigner中name和comment互換

PowerDesigner中name和comment互換 1 PowerDesigner中批量根据对象的name生成comment的脚本 执行方法:Open PDM -- Tools -- Execute Commands -- Run Script Vb script代码   Option Explicit   ValidationMode = 

841

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

PowerDesigner 把Comment写到name中 和把name写到Comment中 (转)

PowerDesigner 把Comment写到name中 和把name写到Comment中 pd7以后版本可用 PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或 Comment中写中文,在Code中写英文。Name...

diaowo5577的专栏 190

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

PowerDesigner 数据库逆向工程,建name和comment 互换

<br />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.IsKi

lester19872007的专栏 1235

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

PowerDesigner 中Comment与name内容互换COPY

在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文。Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题: 代码一:将Name中的字符COPY至Commen

X-Mouses 2068

PowerDesigner 逆向工程注释生成名称

文章来自  http://blog.youkuaiyun.com/hz_blog/article/details/39455463 执行方法:Open PDM -- Tools -- Execute Commands -- Run Script  Vb script代码  可以保存该脚本为:name2comment.vbs '******************************

风中浮柳的专栏 1560
下一篇: Ubuntu 实时监控tomcat日志
javaee1234
博客等级 码龄10年 49粉丝 24原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值