Data modeling tools ------ EZMNL

Table Architecture Designer (EZDML)

 

Table Structure Designer EZDML1.5 new version is released, a lot of improvements over the previous version 1.2 introduced, thus re-wrote the introduction.

Table structure design, the so-called data modeling, currently we used the same well-known tools PowerDesigner, ERWIN, ER-Studio and Rational-Rose, etc., this tool both the functional interface can not compare with them, but the benefits of this tool is a simple, fast and free, there are some unique features. The reason I do such a tool, there are many reasons, such as the above-mentioned tools, in some cases inconvenient, cumbersome installation, accounting for more resources, slower, but also free of charge. At the same time I also used to like to take something to practice hand, usually by the process of developing their own ideas often want to quickly generate program code, we have done just proposed class interface development, so a few years ago began to engage in a simple program slowly changed with ah ah, later he found himself only one person seems to be too self-closing, and on the release came out.

Well, so much long-winded, the next sub-shots that the following steps:
1. Download install
2. Start
3. New Table
4. foreign key
5. modify the table and field properties
6. view switch
7. Export image
8. Export the EXCEL
9. the edit descriptor
10. the generated code
11. import an existing table
12 to generate the database
13. processing case


1.  download and install : nothing to say it is to download and run the installer, a step completed the wizard .

Official Download: http://www.ezdml.com/download/ezdml_setup.exe


2.  Start : Start the program, the Chinese system will see the following screen:



3.  New Table : create a new table, the system displays the new interface:



Direct point of "OK", you can see the results of the new table:



FIG handover to the model:



The same file can have multiple models, the model can be translated in FIG, shrink, enlarge, select an object, like a drag operation. FIG model can assist the operator using the keyboard, by a minus sign zoom, pan direction keys, R recovery, F centered.

Left tree list, select a plurality of tables or fields copy, paste; direct drag can be sorted; typing in "filter" in the upper left to find and list eligible subjects.

4.  Foreign Key :

build a table, check all default field, the effect is as follows:



Next, on the model of FIG select "data of Table 1," then "Connection" on the toolbar:



Then click on "Data Sheet 2", the system pop-up interfaces:



Provided from the associated field of the table is a foreign key relationship to establish "the association number", then "OK" to:



5.  modify the table and field properties :

double-click on the model map "data of Table 1" Pop up the editing interface of the table, a field can be added to remove or drag sorting operations:



Table can be changed directly, logical name physical name, and comments field, a logical name, type, constraint:



It can also double-click on a field to bring up the field attributes interface to modify fields:



The same modify "data in Table 2":



At the same time tinkering foreign key field:



The final results are as follows:



At this point, we can save what files to prevent data loss.

Incidentally, when the system exits automatically save all data to a file under the same name DMH EXE directory, it will automatically read and restored at startup.

6.  view switch :

the above-described model diagram, logical view is displayed by default, perform "model | change physical / logical view" menu command or point toolbar buttons to switch to the second physical view:



默认显示表对象的字段类型是按标准SQL定义,表对象的背景色是浅蓝,可执行“模型|颜色和样式”进行修改:

 



按上述修改结果如下:



7. 导出图片:在模型图上选中一个或多个对象,右键“复制图像”,即可将选中的图形复制到剪贴板,可直接到画笔、WORD等地方粘贴(输出格式为WMF矢量图格式)。



8. 导出EXCEL

在模型图上选中一个或多个对象,右键“导出到Excel”,系统提示输入文件路径:



指定文件路径和名称后,点“保存”,系统提示:



点“确定”,则自动打开Excel:



9. 描述字编辑

描述字编辑功能是本软件的一大特色,即可以用直接用键盘输入快速完成建表。之所以有这个功能,是我觉得建一个表不需要用鼠标点那么多下中间还键盘输入那么麻烦,直接文本编辑是最快的。有了这个功能后方便多了,基本上我建表时也再不去用那个常规界面了。而且用这个来复制粘贴表结构也很方便。

示范如下:

点新建表,并切到“描述”页:



表的描述字中,可以输入简写字母代替数据类型,S,I,F,D,BO,E,BL,O分别代表文本,整数,浮点数,时间,真假,枚举,文件,对象。

输入以下内容,删除或覆盖掉原有文字:



焦点离开输入框时,系统会自动识别并重新生成描述字:



点“确定”,效果如下:



双击打开属性,结果如下:



10. 生成代码

在表的属性窗口中,切换到“生成”页,可生成多种代码,包括:

■标准SQL:

■ORACLE:

■MYSQL:

■C++:

■PASCAL:

■C#:

■JAVA:


11. 导入现有表

即常说的逆向工程了。导入生成功能可支持ORACLE、MYSQL、SQLSERVER和ODBC数据库。这里我以Microsoft Access附带的“罗斯文商贸”数据库为例:

首先新建一个模型,并重命名为“罗斯文商贸”:



执行“模型|导入数据库”菜单命令,系统显示导入界面并提示连接数据库:



选择ODBC并连接到MS Access MDB文件,系统列出已有表:



其中“自动大小写”的意思是自动对表名和字段名进行首字母大小处理(如USERINFO会处理为UserInfo,系统根据字典文件dict.txt进行处理,如果对处理结果不满意,可修改字典文件增加你需要的词语);“注释转为逻辑名”意思是把表或字段的注释作为逻辑名称导入。

点导入,会提示有些系统表无法导入:



点“确定”跳过,最终结果如下:



12. 生成数据库

为了说明生成功能,我们先找第一个表修改一下,增加文本字段“销售情况”,并把“产品销售额”由“浮点(19)”改为“浮点(10,2)”:



执行“模型|生成数据库”菜单命令,系统显示生成数据库界面:



先不连接数据库时,直接点击“生成SQL”,生成的是创建表的标准SQL:



连接数据库,再生成一次,这时生成的SQL只是发生变化的表和字段:



其中“产品销售额”由“浮点(19)”变为“浮点(10,2)”,由于值域变小了,必须重新生成字段。为了防止数据丢失,系统生成的SQL是先把它改名,然后创建新字段,并把数据从旧的字段UPDATE到新字段中,最后删除原有字段的SQL(为防止数据丢失,删除字段的SQL默认以注释的形式生成,可手工修改将注释符去掉)。

而销售情况是新字段,就直接生成了创建字段的SQL。

可直接修改SQL的内容,点击“执行”可以执行相应SQL生成数据库,也可以把SQL复制到管理工具的SQL窗口中执行。

13. 大小写处理

最后说一下大小写处理功能。从数据库导进来的表一般都是全大写或不分大小写的,有时比较难分辨,不利于查看。例如上述部门表生成到ORACLE数据库后,再从数据库导进来时,会变成全大写:



这时可以点左下方的“大小写转换”按钮,弹出菜单如下:



执行“自动大小写”,系统处理的效果如下:



“自动大小写”的意思是自动对表名和字段名进行首字母大小处理。例如USERINFO会处理为UserInfo。处理过程是根据字典文件dict.txt进行的,如果对处理结果不满意,可修改字典文件增加你需要的词语。

 

Guess you like

Origin www.cnblogs.com/spstart/p/11069770.html