一、关系
网上找了一下,大部分说得不太清楚,我在这里举上个例子。注意,这里的关系是逻辑上的,并非表结构也要如此。
1. 标识关系identifying relationship
意思:子实体的主键包含父实体的外键(可能成为复合主键compound keys)
The primary key attributes of the parentbecome primary key attributes of the child.
e.g.
Parent | Child | ||
Table | Account | PersonAccount | |
Column | AccountID | AccountID | PersonID |
Value1 | At1 | A1 | p1 |
Parent | Child | ||
Table | Person | Phone | |
Column | _id | _id | phoneNo |
Value1 | a | a | 135 |
Value2 | a | 137 |
2. 非标识关系non-identifyingrelationship
意思:子实体自己的主键就可唯一标识
The primary key attributes of the parentmust not become primary key attributes of the child.
e.g.
Parent | Child | ||
Table | AccountType | Account | |
Column | AccountTypeID | AccountID | AccountTypeID |
Value1 | At1 | A1 | At1 |
Value2 | At2 |
Parent | Child | ||
Table | States | Person | |
Column | state | _id | state |
Value1 | cn | a | cn |
3. mandatory
A foreign key value must exist in the childentity, the foreign key value must be found in the primary key of the parent.
NOT NULL
父子关系是1:m
4. optional
the foreign key value is not alwaysrequired in the child entity; however, if a value does exist, then the foreignkey value must be found in the primary key of the parent.
NULL
父子关系是0:m or 1:m
5. 综合
Identifying relationship 没有 optional,如下图是不允许的
Parent | Child | ||
Table | Person | Phone | |
Column | _id | _id | phoneNo |
Value1 | a | a2 | 135 |
综合1对多等情况,对应上ER/Studio连线图样如下:
二、创建Naming Standard
参考:http://learndatamodeling.com/blog/how-to-create-naming-standards-in-embarcaderos-data-architect/
简单来说就是自建个csv文件,如:
DEPARTMENT | DPRTMNT |
NUMBER | NMBR |
NAME | NM |
… | … |
然后去Tools > Naming Standards Template Editor 编辑:
然后再到Model > Naming Standards Utility 导入。