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. 一个渣渣tomcat的学习成果.

    //////////////////////////////////////写在前面////////////////////////////////////// 时隔几个月,恢复更新了,之前由于一些私 ...

  2. Codeforces 938E Max History:排列 + 逆元【考虑单个元素的贡献】

    题目链接:http://codeforces.com/problemset/problem/938/E 题意: 定义f(a): 初始时f(a) = 0, M = 1. 枚举i = 2 to n,如果a ...

  3. phalcon查询:单条查询,多条查询,多表查询

    单条查询, $order = \OrderMain::findFirst("oid='" . $oid . "'"); 多条查询, $shop = \Order ...

  4. MySQL 大数据量修改表结构问题

    前言: 在系统正常运作一定时间后,随着市场.产品汪的需求不断变更,比较大的一些表结构面临不得不增加字段的方式来扩充满足业务需求:  而 MySQL 在体量上了千万.亿级别数据的时候,Alter Tab ...

  5. C#中的线程(四)高级话题

    C#中的线程(四)高级话题   Keywords:C# 线程Source:http://www.albahari.com/threading/Author: Joe AlbahariTranslato ...

  6. gulp插件之-----转化es6代码到es5 取消严格模式 remove "use strict" directive

    Installation npm install babel-plugin-transform-remove-strict-mode && yarn add babel-plugin- ...

  7. 201621123014《Java程序设计》第七周学习总结

    1. 本周学习总结 1.1 思维导图:Java图形界面总结 答: 1.2 可选:使用常规方法总结其他上课内容. 答:1.Swing组件主要分为容器组件和其他组件. 2.JFrame和JPanel都可以 ...

  8. dyci——IOS动态代码注入

    有时候用xib,更改了布局需要重新运行才可以看到效果,对于比较复杂的应用尤其浪费时间,下面介绍一个工具dyci-不需要重Run应用,也能看到效果 yci的网址:https://github.com/D ...

  9. BZOJ3832 Rally

    传送门(权限) 题目大意 给定一个有向无环图,可以删去一个点和所有与它相连的边,使得图的其余部分最长路径最小,求这个位置和最小的最长路径长度. 题解 对于每一条边$u\rightarrow v$,设$ ...

  10. Redis底层探秘(一):简单动态字符串(SDS)

    redis是我们使用非常多的一种缓存技术,他的性能极高,读的速度是110000次/s,写的速度是81000次/s.这么高的性能背后,到底是怎么样的实现在支撑,这个系列的文章,我们一起去看看. redi ...