Option   Explicit

ValidationMode   =   True

InteractiveMode =   im_Batch

Dim   mdl   '当前model

'获取当前活动model

Set   mdl   =   ActiveModel

If   (mdl   Is   Nothing)   Then

MsgBox   "There   is   no   current   Model "

ElseIf   Not   mdl.IsKindOf(PdcDM.cls_Model)   Then '如果是处理pdm,这里换成PdPDM.cls_Model

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   ref   '要处理的对象

for   each   ref   in  folder.relationships

if   not   ref.isShortcut   then

if instr(lcase(ref.code),"relationship_") =1  then

dim ctable '子表名称
                 ctable= lcase(ref.entity1.name)
                 dim ptable '父表名称
                 ptable=lcase(ref.entity2.name)
                
                 dim relation
                 if(len(ptable)>12) then
                 relation=         mid(ptable,1,8)+mid(ptable,len(ptable)-3)
                 else
                 relation=ptable
                 end if
                 relation=relation+"-"
                
                 if(len(ctable)>12) then
                 relation=relation+mid(ctable,1,8)+mid(ctable,len(ctable)-3)
                 else
                 relation=relation+ctable
                 end if
                 relation=ucase(relation)
                                 
                 output ref.name+">>>>"+ relation
                 ref.name=relation
                 ref.code=relation

end if

end if

next

'22222222222222222222222222222222222222222222222222222222222222222222222处理继承关系

for   each   ref   in  folder.inheritances

if   not   ref.isShortcut   then

'output ref.ParentEntity.name+"//"+ref.ChildrenList

dim ctable '子表名称

ctable= lcase(ref.ChildrenList)

dim ptable '父表名称

ptable=lcase(ref.ParentEntity.name)

dim relation

if(len(ptable)>12) then

relation=         mid(ptable,1,8)+mid(ptable,len(ptable)-3)

else

relation=ptable

end if

relation=relation+"-"

if(len(ctable)>12) then

relation=relation+mid(ctable,1,8)+mid(ctable,len(ctable)-3)

else

relation=relation+ctable

end if

relation=ucase(relation)

output folder.parent.name+"--->"+folder.name+"--->"+ref.name+"}}}}}"+ relation

ref.name=relation

ref.code=relation

end if

'  end if

next

'递归遍历子文件夹

Dim   f   '子文件夹

For   Each   f   In   folder.Packages

if   not   f.IsShortcut   then

ProcessFolder   f

end   if

Next

end   sub

将CDM中所有以Relatonship_开头的关系全部重命名,避免生成数据库因为重复关系名报错的更多相关文章

  1. 【mybatis】mybatis执行一个update方法,返回值为1,但是数据库中数据并未更新,粘贴sql语句直接在数据库执行,等待好久报错:Lock wait timeout exceeded; try restarting transaction

    今天使用mybatis和jpa的过程中,发现这样一个问题: mybatis执行一个update方法,返回值为1,但是数据库中数据并未更新,粘贴sql语句直接在数据库执行,等待好久报错:Lock wai ...

  2. MySql语句中select可以嵌套么,字段的重命名可以用中文么

    今天文档中看到的查询语句,SELECT后面又跟了一个SELECT嵌套,而且把字段重命名为中文,请问可以这样做么 MySql语句中select可以嵌套么,字段的重命名可以用中文么 >> my ...

  3. 如果在Yii中,使用AR查询,不直接写sql,则在使用的时候会报错

    如果在Yii中,使用AR查询,不直接写sql,则在使用的时候会报错 Student::find() ->select("id,name,from_unixtime(create_tim ...

  4. vue中"‘webpack-dev-server’不是内部或外部命令,也不是可运行的程序"的报错

    在vue项目中发现了这个报错  解决办法将项目里的“node_modules”文件夹删除,然后重新运行cnpm install

  5. NetCore 3.0 中使用Swagger生成Api说明文档及升级报错原因

    认识Swagger Swagger 是一个规范和完整的框架,用于生成.描述.调用和可视化 RESTful 风格的 Web 服务.总体目标是使客户端和文件系统作为服务器以同样的速度来更新.文件的方法,参 ...

  6. PDM生成数据库-0设置表名和字段名中不带双引号

    如果PDM直接导出脚本的话,所有的表和字段都会被加上双引号,非常不方便,去除双引号的办法: Database->Edit Current DBMS在弹出窗体中第一项General中找到 Scri ...

  7. 在myeclipse中maven项目关于ssh整合时通过pom.xml导入依赖是pom.xml头部会报错

    错误如下 ArtifactTransferException: Failure to transfer org.springframework:spring-jdbc:jar:3.0.5.RELEAS ...

  8. 利用Eclipse中的Maven构建Web项目报错(一)

    利用Eclipse中的Maven构建Web项目 1.在进行上述操作时,pom.xml一直报错 <project xmlns="http://maven.apache.org/POM/4 ...

  9. RN项目中使用react-native-elements报错: Unrecognized font family 'Material Icons'

    查询了一些方案,但各自的环境不尽相同,最后在google中找到了答案.主要问题在于 (1)版本问题 (2)Xcode配置问题 报错如下 解决步骤: 1 . 首先需要正确安装 npm i -S reac ...

随机推荐

  1. ZC_注意点

    1. domain类 里面的 属性的类型,一般都是用 包装类 2. 使用 "Hibernate Reverse Engineering ..." 来进行自动生成domain类和?? ...

  2. 我的java mvc

    mint mvc 并不是我原创的.她的基础是廖雪峰老师的webwind mvc. webwind是廖老师模仿spring的一个 rest 风格的 mvc 框架,功能简单,但是mvc的核心功能基本具备了 ...

  3. redis.h

    [对象] typedef struct redisObject {     unsigned type:4;[REDIS_STRING,REDIS_LIST, HASH, SET, ZSET]     ...

  4. 解决:创建Android模拟器时提示“No system images installed for target”

    今天在Eclipse上创建安卓模拟器,但发现CPU/ABI一项显示为“No system images installed for target”: 在网上搜索答案,在叶超Luka的博客中找到了答案, ...

  5. iOS开发中的系统版本比较

    由于系统平台和SDK更新迭代,一部分过时的成员.方法会被彻底从SDK中移除,为了兼容旧的设备,这时就需要区分系统平台版本调用正确的API. 另一种情况是iOS设备的屏幕和设备参数不同,虽然UI上的Au ...

  6. linux 部署python

    tar xf Python-.tar.xz cd Python-./configure make make install ln -s /usr/local/bin/python2. /usr/bin ...

  7. android根据原图片的路径得到该图片的缩略图

    /** * 根据图片的路径得到该图片在表中的ID * @param cr * @param fileName * @return */ public static String getImageIdF ...

  8. 剑指offer--13.二进制中1的个数

    就是猜测试数据没有负数,哈哈 ----------------------------------------------------------------- 时间限制:1秒 空间限制:32768K ...

  9. 利用Fiddler或Charles进行mock数据创造测试环境

    使用场景:服务器数据不符合测试条件时,我们可以通过在本地创建虚拟数据来打到测试用例所描述的条件. fiddler使用方法 1.首先在本地创建txt数据:将抓到的response中的json数据拷贝到记 ...

  10. RTP协议全解(H264码流和PS流)

    写在前面:RTP的解析,网上找了很多资料,但是都不全,所以我力图整理出一个比较全面的解析, 其中借鉴了很多文章,我都列在了文章最后,在此表示感谢. 互联网的发展离不开大家的无私奉献,我决定从我做起,希 ...