PD name 和 comment 互换

news/2024/7/5 19:20:48

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

执行方法:Open PDM -- Tools -- Execute Commands -- Run 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

-----------------------------------------------------------------------

2 PowerDesigner中逆向工程将数据库中comment脚本赋值到PDM的name

执行方法:Open PDM -- Tools -- Execute Commands -- Run 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

 

 

摘自:http://antzantz.blog.sohu.com/106822073.html

转载于:https://www.cnblogs.com/xm_cpppp/p/3582816.html


http://www.niftyadmin.cn/n/2455063.html

相关文章

mongodb 监控工具 mongo-monitor 安装部署

mongo 集群监控工具 mongo-monitor 安装部署 调试mongodb 集群期间发现一个小神器&#xff0c;不敢独享&#xff01;相关介绍如下&#xff1a;mongo-monitor CLI是一个简洁和简单的工具来检查MongoDB的服务&#xff0c;在集群调试升级期间&#xff0c;故障排查&#xff0c;添加…

笔记:lucene学习

流程&#xff1a; 创建索引库&#xff1a; 1&#xff09; 创建JavaBean对象 2&#xff09; 创建Docment对象 3&#xff09; 将JavaBean对象所有的属性值&#xff0c;均放到Document对象中去&#xff0c;属性名可以和JavaBean相同或不同 4&#xff09; 创建IndexWriter对象…

抓包工具Charles简单使用介绍

一是拦截别人软件的发送的请求和后端接口&#xff0c;练习开发。二是自己后端返回的response拦截修改后再接收以达到测试临界数据的作用。三写脚本重复拦截抓取别人的数据。四支持流量控制&#xff0c;可以模拟慢速网络以及等待时间&#xff08;latency&#xff09;较长的请求。…

基于cygwin构建u-boot(五)结尾:shell 工具

结尾&#xff0c;基于cygwin对u-boot的处理&#xff0c;很大一部分都是再处理 路径等相关的问题&#xff0c;只有一个涉及到gcc的参数配置。 为了达到顺利编译的目的&#xff0c;使用shell下的部分工具进行处理。 1、sed sed简单说&#xff0c;是一种按照特定处理方式&#xff…

笔记:shiro与spring整合

官方网站&#xff1a;http://shiro.apache.org/spring.html 视频来自于&#xff1a;http://www.java1234.com/ 1.建表&#xff1a;用户表t_user、角色表t_role、权限表t_permission CREATE DATABASE test ;USE test;DROP TABLE IF EXISTS t_permission;CREATE TABLE t_permis…

笔记:CXF与spring整合

webService服务地址&#xff1a;http://www.webxml.com.cn 一&#xff1a;接收服务 步骤&#xff1a;得到服务地址----wsimport代理-------打jar包------放到项目中-------通过wsdl元素调用相关的方法得到数据 wsdl描述图&#xff1a; - wsimport 命令的位置&#xff1a; …

XMPP即时通讯资料记录

几天开始研究XMPP即时通讯的技术&#xff0c;来实现移动应用的计时聊天功能。记录下参考的博客地址&#xff0c;还挺详细的。 http://blog.csdn.net/fhbystudy/article/details/16117561 http://blog.sina.com.cn/s/blog_aef8b52701019sle.html 转载于:https://www.cnblogs.com…

springboot-logback

springboot logback配置 1.pattern解析&#xff1a; %d{yyyy-MM-ddTHH:mm:ss.SSSXXX}   带时区的时间 %level   日志级别 [%thread]   线程名 [%logger{50}:%line]   打印日志对应的方法和行数  [uuid:%X{operation_id}]   这个是logback的MDC机制&#xff0c;没有…