hj_powerDesigner一天踩坑之旅

下载安装破解powerdesigner16.5,不要汉化.网上教程,没难度.

参考:https://www.fujieace.com/software/powerdesigner.html

安装jdk32位的,这个很重要,其他解决方式还没尝试成功. 然后配置jdk ,这个千万别漏.

Tools --> General Options --> Variabl

JAR E:\java-tools\Java\JDK7\jdk1.7.0_60 \jar.exe
JAVA E:\java-tools\Java\JDK7\jdk1.7.0_60 \java.exe
JAVAC E:\java-tools\Java\JDK7\jdk1.7.0_60\ avac.exe
JAVADOC E:\java-tools\Java\JDK7\jdk1.7.0_60\ javadoc.exe

配置导出Word的模板

Available items -- List of Tables 双击移动至右侧,用于显示全部表信息

Available items -- Table -- List of Table Columns 双击移动至右侧,用于显示单表信息 

右键可以调节显示信息; format ,layout(name,data type,length,comment) footer,header;

 

再就是很关键的脚步修改:database--Edit current DBMS--以下针对postsql

General---Script--Objects--Column--SqlLIstQuery

{OWNER, TABLE, COLUMN, DTTPCODE, LENGTH, PREC, ISMAND, DEFAULT, COMMENT}

select
pg_get_userbyid(t.relowner),
t.relname,
c.attname,
case(c.attndims) when 0 then d.typname else (select x.typname from pg_type x where x.oid = d.typelem) || '[]' end,
case(c.atttypmod >> 16) when 0 then (c.atttypmod - ((c.atttypmod >> 16)<<16) - 4) else (c.atttypmod >> 16) end,
case(c.atttypmod >> 16) when 0 then 0 else (c.atttypmod - 65536 * (c.atttypmod / 65536) - 4) end,
CAST(NULLIF(c.attnotnull,false) as VARCHAR(1)),   这是修改后的 不改这 sql语句报错.导出表没字段
case(c.atthasdef)
when true then (select adsrc::varchar from pg_attrdef f where f.adrelid = t.oid and f.adnum = c.attnum)::varchar
else '' end::varchar as coln,
col_description(t.oid, c.attnum)
from
pg_class t
join pg_attribute c on (c.attrelid = t.oid and c.attnum > 0 and c.attisdropped is false)
join pg_type d on (d.oid = c.atttypid)
where t.relkind = 'r'
[ and pg_get_userbyid(t.relowner) = %.q:OWNER%]
[ and t.relname = %.q:TABLE%]
order by 1, 2, c.attnum

General--Script--Objects--Key--SqlListQuery

{OWNER ID, TABLE ID, CONSTNAME ID, ISPKEY ID, COLUMNS ...}

select
pg_get_userbyid(t.relowner),
t.relname,
i.relname,
CAST(NULLIF(x.indisprimary,false) as VARCHAR(1)), 这条语句解决comment注释问题
a.attname || ','::varchar
from
pg_index x
join pg_class t on (t.oid = x.indrelid and t.relkind = 'r')
join pg_class i on (i.oid = x.indexrelid)
join pg_attribute a on (a.attrelid = i.oid)
where x.indisprimary is true
[ and pg_get_userbyid(t.relowner)=%.q:OWNER%]
[ and t.relname=%.q:TABLE%]
order by 1, 2, 3, a.attnum

 

选择jdbc连接,路劲指向jar包所在,连接数据库就可以反向生成物理数据模型了,然后根据模板,导出rtf文件,转成Word文档就大功告成.

坑:jdk32,sql脚本语言(2处),数据模板,jar包位置,连接方式,跟idea里面数据库连接配置基本一致.

 

posted @ 2019-12-24 18:23  独孤~华剑  阅读(560)  评论(0编辑  收藏  举报
独孤华剑