Powerdesigner custom DBMS (take derby database as an example)

Source: Internet
Author: User
Tags powerdesigner
Powerdesigner is defined by ourselves when the default DBMS supported by PD. PD is insufficient. Take the apachederby database as an example. 1. The DBMS definition file PD's DBMS definition file is placed in the install_dirResourceFilesDBMS directory. The first step of a custom DBMS is to copy a ready-made DBMS file.

Powerdesigner is defined by ourselves when the default DBMS supported by PD. PD is insufficient. Take the apache derby database as an example. 1. The DBMS definition file PD's DBMS definition file is stored in the install_dir/Resource Files/DBMS directory. The first step of a custom DBMS is to copy a ready-made DBMS file.

Powerdesigner (PD.
When the default DBMS supported by PD is insufficient, we need to define it ourselves.
Take the apache derby database as an example.
1. DBMS definition file
The DBMS definition file of PD is stored in the install_dir/Resource Files/DBMS directory. The first step of a custom DBMS is to copy a ready-made DBMS file. Since derby has many similarities with Oracle, you can copy the DBMS file of Oracle and rename it derby. xdb.

2. Modify the description
Use the log book to open derby. xdb and modify some of the first 16 rows. Such as code and name. My overview is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16








> 04DFD581-D1C0-43E8-B9AE-01951ECAB446
> Apache Derby
> DERBY
> 0
/>
> 1243501756
> Test
>
> DERBY

After this modification, when we select Change Current DBMS in the database menu of PD, we can see that one of the drop-down options is Apache Derby.

3. modify data type conversion
Because the dmbs file of oracle we copied is inconsistent with some data types in derby, we need to modify it. In the database menu, select Edit Current DBMS. the pop-up window is as follows:

The tree structure is on the left, and the content is edited on the right.

When modifying the Data Type, select Script-> Data Type in the left-side tree.
Let's talk about how fields are processed during the PD database switch. PD itself defines A set of internal data types, such as A % n, N, N % s, % p, among which:
% N is the length of the data type
% S is the size of the data type
% P is the precision of the data type
When we replace dbms a with another dbms B, PD will first convert the Data Type of A to the data type defined internally by PD, the conversion rule here is called A-PD, and then convert the internal data type to B's data type, which is called PD-B, through the above two steps to achieve A to B type conversion.

The A-PD rule defines the PhysDataType node under the Data Type Node just opened, the PD-B rule is defined under the AmcdDataType node.
Here are some simple examples:
A. Oracle NUMBER-> Derby BIGINT
First, check the dbms file of Oracle. Note that it is from Oracle. expand it to the PhysDataType node and see the following ing.
Physical Model | Internal
NUMBER | N
Therefore, after A-PD rules are passed, Oracle's NUMBER type is converted to PD's internal type N.
Next, check the Derby dbms, open the AmcdDataType node, and find the following ing:
Internal | Physical Model
N | NUMBER
Change the NUMBER above to BIGINT.
In this case, the field in Derby will change to the BIGINT type after PD-B rules.

B. Derby BIGINT-> Oracle NUMBER
But you need to check the PhysDataType of Derby and the AmcdDataType node of Oracle.

The preceding two examples show that the PhysDataType node is used to convert the database type to the PD type, while the AmcdDataType converts the internal type of the PD to the database type.
In addition, you can use % n, % s, and % p to achieve more precise conversion, and these three identifiers can also be completely replaced by numbers.

4. Notes
Modify the Column comment. The Table comment is under the Script \ Objects \ Table and Script \ Objects \ Column nodes. Other modifications are similar, such as indexes and dependencies.

The Script \ SQL \ Syntax node contains some basic SQL Syntax requirements, such as the--start comment and the SQL Terminator.

For more details, refer to the manual:
1, derby: http://db.apache.org/derby/docs/10.9/ref/crefsqlj31068.html
2. PD: http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc38628.1510/doc/html/rad1232022090125.html
3. 20 tips for designing databases using POWERDESIGNER

Let's talk about the PD generation database design document.
The document generated by the default template is useless and cannot be viewed. Therefore, we can customize document templates. In the Report-> Report Templates menu, in the pop-up window, click New, enter a name, and then the template editing page is displayed, which is divided into two parts, you can drag the required elements on the left to the right. By default, the Report template is placed under the installation directory \ Resource Files \ Report Templates \. You can also copy the Files under this directory, change the name, and then modify the template accordingly.

In a word, PD is very powerful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.