PowerDesigner 逆向中 Name和Comment互换
在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在NAME或Comment中写中文,在Code中写英文。Name用来显 示,Code在代码中使用,但Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题:
- 代码一:将Name中的字符COPY至Comment中
- 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 comment 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
另外在使用REVERSE ENGINEER从数据库反向生成PDM的时候,PDM中的表的NAME和CODE事实上都是CODE,为了把NAME替换为数据库中Table或Column的中文Comment,可以使用以下脚本:
- 代码二:将Comment中的字符COPY至Name中
- 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
以上两段代码都是VB脚本,在PowerDesigner中使用方法为:
PowerDesigner->Tools->Execute Commands->Edit/Run Scripts
将代码Copy进去执行就可以了,是对整个CDM或PDM进行操作
PowerDesigner 逆向中 Name和Comment互换的更多相关文章
- PowerDesigner逆向操作(从mysql5.0生成数据库的物理模型),把Comment写到name中,pdm文件导出为word
PowerDesigner逆向操作(从mysql5.0生成数据库的物理模型) 环境:powderdesigner12.5:mysql5.0步骤:1. 为指定的数据库配置mysql的ODBC数据源先下载 ...
- PowerDesigner 的mysql PDM 的COMMENT注释
PowerDesigner 的mysql PDM 的COMMENT注释 2012-11-01 15:38 4447人阅读 评论(0) 举报 分类: 数据库相关(7) PowerDesigner 的my ...
- android apk 逆向中常用工具一览
关于apk 逆向中的一些工具的使用,看了不少文章,也使用过有很长一段时间了,今天对此做一总结: 几种文件之间的转换命令: 1. odex -> smali java -jar baksmali ...
- C#中文件和byte[]互换问题
如何将图片和声音转化成byte[],并通过webservice进行传输? 如何将webservice传输过来的byte[],转化成我们想要的文件? (一)文件转化为byte[] 方法 ...
- 逆向中静态分析工具——IDA初学者笔记之字符串分析
逆向中静态分析工具——IDA初学者笔记之字符串分析 程序中往往包含很多字符串资源,这些资源存在于PE文件的rdata段,使用IDA反编译后,可以查找到这些字符串, 逆向破解程序通常需要一个突破点,而这 ...
- 逆向中静态分析工具——IDA初学者笔记
逆向中静态分析工具——IDA初学者笔记 //****************************************************************************** ...
- 安卓日常开发和逆向中常用的shell命令与非shell命令
简述shell 命令与 非shell命令区别 shell命令不用先adb shell进入界面执行 非shell命令必须要 adb shell进入界面执行 基础非shell命令 1.安装app adb ...
- RPC 技术及其框架 Sekiro 在爬虫逆向中的应用,加密数据一把梭!
什么是 RPC RPC,英文 RangPaCong,中文让爬虫,旨在为爬虫开路,秒杀一切,让爬虫畅通无阻! 开个玩笑,实际上 RPC 为远程过程调用,全称 Remote Procedure Call, ...
- PowerDesigner中NAME和COMMENT的互相转换,需要执行语句
原文: http://www.cnblogs.com/xnxylf/p/3288718.html 由于PDM 的表中 Name 会默认=Code 所以很不方便, 所以需要将 StereoType 显示 ...
随机推荐
- 常用软件:Bugzilla的搭建(转)
1.安装依赖包yum -y install php perl httpd mod_ssl mysql-server mysql-devel mysql php-mysql gcc mod_perl-d ...
- 6个强大的AngularJS扩展应用
本文链接:http://www.codeceo.com/article/6-angularjs-extension.html本文作者:码农网 – 小峰 AngularJS现在非常热门,是Google推 ...
- Android AChartEngine 饼图渐变效果
二话不说,先上图 核心代码如下: private void initLabelChat(View rootView) { NumberFormat nf = new DecimalFormat(&qu ...
- MyBatis与Hibernate的比较
Hibernate 与Mybatis都是流行的持久层开发框架,但Hibernate开发社区相对多热闹些,支持的工具也多,更新也快,当前最高版本4.1.8.而Mybatis相对平静,工具较少,当前最高版 ...
- C#中的using关键字用法总结
C#中的using关键字主要有两种用法: 1.using作为指令: (1)用于将命名空间引入当前单元,例如:using System.Windows.Forms; (2)为现有的命名空间创建一个别名, ...
- 很不错的在线Office控件:IWebOffice与SOAOffice
http://blog.csdn.net/cjh200102/article/details/17220441 iWebOffice2003文档控件 iWebOffice2003网络文档中间件能够在I ...
- [Doxygen]Doxygen
1. Doxygen做什么? 首先这是一个文档生成工具,而不是代码中的注释生成工具.其次,如何生成对应文档,那就是按照一个配置文件中给出的配置格式来书写注释的时候,通过工具就可以解析代码注释最终生成文 ...
- windows2003 IIS6.0右键属性没有asp.net选项卡的解决办法
windows2003 IIS6.0右键属性没有asp.net选项卡的解决办法 1,如果是只安装了.net framework 1.1 在iis中是不显示那个选项卡的.默认就会支持asp.net1.1 ...
- WPF控件 RichTextBox查找定位匹配字符
private void Search_Click(object sender, RoutedEventArgs e)//查询定位文本 { List<TextRange> textRang ...
- 基于Autofac, Castle.DynamicProxy的动态WCF解决方案(原创)
本方案解决了下面3个主要的问题: 1.减少配置,为了避免每次新增service都需要去修改配置文件,包括服务器端跟各个客户端的. 2.能够使用函数重载,泛型函数,以及泛型类. 3.使项目能够快速地在w ...