• powderdesigner 关于mysql生成pdm和java的方法


    powderdesigner 关于mysql生成pdm和java的方法

    首先将数据库的表导出为SQL文件。下载安装PowerDesigner工具。

    下面以图文的形式讲解:


    PowerDesign不让name和code联动

    PowerDesign中的选项菜单,在[Tool]-->[General Options]->[Dialog]->[Operating modes]->[Name to Code mirroring],这里默认是让名称和代码同步,将前面的勾号去掉就行了。

    显示Comment注释(comment-->name)

    打开菜单Tools>Execute Commands>Edit/Run Script.. 或者用快捷键 Ctrl+Shift+X

    1. Option Explicit
    2. ValidationMode = True
    3. InteractiveMode = im_Batch
    4. Dim blankStr
    5. blankStr = Space(1)
    6. Dim mdl ' the current model
    7. ' get the current active model
    8. Set mdl = ActiveModel
    9. If (mdl Is Nothing) Then
    10. MsgBox "There is no current Model "
    11. ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
    12. MsgBox "The current model is not an Physical Data model. "
    13. Else
    14. ProcessFolder mdl
    15. End If
    16. Private sub ProcessFolder(folder)
    17. On Error Resume Next
    18. Dim Tab 'running table
    19. for each Tab in folder.tables
    20. if not tab.isShortcut then
    21. tab.name = tab.comment
    22. Dim col ' running column
    23. for each col in tab.columns
    24. if col.comment = "" or replace(col.comment," ", "")="" Then
    25. col.name = blankStr
    26. blankStr = blankStr & Space(1)
    27. else
    28. col.name = col.comment
    29. end if
    30. next
    31. end if
    32. next
    33. Dim view 'running view
    34. for each view in folder.Views
    35. if not view.isShortcut then
    36. view.name = view.comment
    37. end if
    38. next
    39. ' go into the sub-packages
    40. Dim f ' running folder
    41. For Each f In folder.Packages
    42. if not f.IsShortcut then
    43. ProcessFolder f
    44. end if
    45. Next
    46. end sub

    将name设置成comments:

    1. Option Explicit
    2. ValidationMode = True
    3. InteractiveMode = im_Batch
    4. Dim mdl ' the current model
    5. ' get the current active model
    6. Set mdl = ActiveModel
    7. If (mdl Is Nothing) Then
    8. MsgBox "There is no current Model "
    9. ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
    10. MsgBox "The current model is not an Physical Data model. "
    11. Else
    12. ProcessFolder mdl
    13. End If
    14. ' This routine copy name into comment for each table, each column and each view
    15. ' of the current folder
    16. Private sub ProcessFolder(folder)
    17. Dim Tab 'running table
    18. for each Tab in folder.tables
    19. if not tab.isShortcut then
    20. tab.comment = tab.name
    21. Dim col ' running column
    22. for each col in tab.columns
    23. col.comment= col.name
    24. next
    25. end if
    26. next
    27. Dim view 'running view
    28. for each view in folder.Views
    29. if not view.isShortcut then
    30. view.comment = view.name
    31. end if
    32. next
    33. ' go into the sub-packages
    34. Dim f ' running folder
    35. For Each f In folder.Packages
    36. if not f.IsShortcut then
    37. ProcessFolder f
    38. end if
    39. Next
    40. end sub

    设置联动


    在powerdesign中,code与name老是联动,修改了name中的数据,code随之修改,影响效率,设置Tools-General Options-Dialog 中的Name to Code mirroring(不选中) 可以解决这个问题 。

    生成sql字段自定义

    Database->Edit current database,选择Script->Object->column

    这样就把name

     

  • 相关阅读:
    TypeScript教程-2022
    SQL Server教程 - SQL Server 复制(Replication)
    基于海鸥算法优化的lssvm回归预测-附代码
    线阵相机参数介绍---变频参数控制
    docker的小秘密--digests仓库校验码(如何修改digests)
    DDD之领域(Domain)和子域(Subdomain)
    多级别划分化学制品制造业经销商,经销商商城系统优化企业分销渠道链
    k8s.7-Kubernetes集群UI及主机资源监控
    使用IDEA创建一个SpringBoot项目
    【java学习】面向对象特征之一:封装和隐藏(23)
  • 原文地址:https://blog.csdn.net/qq_27173485/article/details/90034385