티스토리 뷰

DB

토드데이터모델러 logical 변환하기

후늬뉨 2013. 6. 11. 10:16

사전작업 - 테이블에 코멘트를 모두 달아줄것

Settings > Option 에서 Expert Mode 를 체크한뒤

Tools > Script Window 를 실행하여 아래 코드를 붙히고 실행한다.

function main() {
  var app = System.GetInterface('Application');
  var Model = app.Models.GetObject(0);
  //... parameter in GetObject determines with which model the script should work.
  //0 = first model listed in the Application View, 1 = second model listed in the Application View etc.
  var e, Entity, a, Attribute;
  for (e = 0; e < Model.Entities.Count; e++) {
    Entity = Model.Entities.GetObject(e);
    if (Entity.Comments != "") {
      Entity.Caption = Entity.Comments;
      Log.Information(
          Entity.FullName + ": Transfered Entity.Comments to Entity.Caption.");
    }
    for (a = 0; a < Entity.Attributes.Count; a++) {
      Attribute = Entity.Attributes.GetObject(a);
      if (Attribute.Comments != "") {
        Attribute.Caption = Attribute.Comments;
        Log.Information(Entity.FullName + "." + Attribute.FullName
            + ": Transfered Attribute.Comments to Attribute.Caption.");
      }
    }
  }
}

저장한뒤 프로그램을 껏다켜면 Attribute가 모두 comment로 치환되어있을것이다.

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함