- Defined as,
- Extended by,
- Has,
- Includes,
- Known by,
- Owned by,
- Qualified by and
- Refers to
There are 3 differenet relations groups available, they are
Definition relations - declare files to exist
Key relations - define the keys in files
Attribute relations - declare non-key fields in files
Usage Type ------------- Relation ---------------------Used for
Definition ------------> Defined as ------------> File-to-file relationship
Key-------------------> Owned by ------------> File-to-file relationship
'' -------------------> Known by ------------> File-to-field relationship
" -------------------> Qualified by------------> File-to-field relationship
Attribute -------------> Refers to -------------> File-to-file relationship
'' --------------------->Includes --------------> File-to-field relationship
" ---------------------->Has -------------------> File-to-field relationship
Other-----------------> Extended by ----------> File-to-file relationship
1. Defined as :
File-to-file relationship.
Defined as relation is automatically created for a file if a reference is made to a non-existing file.
e.g. Employee Defined as Employee.
2. Owned by:
File-to-file relationship
Key fields of owing file become key fields of owned file. Attributes of owning file will become virtual fields of owned file.
e.g. Orderdetail OWNED BY Order
3. Known by:
Specifes the key field(s) for a file
e.g. Order KNOWN BY Order No
4. Qualified by:
To qualify a file indentifier by one or more variable factors like date, time, sequence number etc.
Appropriate fields of referring file can be redirected (RDR) to the effective field in referred file with a possibility of specifying *PREVIOUS or *NEXT field in the relation must be ATR and not CDE.
e.g.
Product Price Owned by Product Code
Product Price Qualified by Effective date
Product Price Has Product price
5. Has Relation
Declares a field to be present in afile as an attribute.
e.g. Order HAS Quantity
6.Includes Relation
File includes all the fields of a strucutre (STR) file.
e.g. Product INCLUDES Auditstamp -----------> (STR) File
7. Refers to Relation
File refers to another file.
Allows access to any of the fields on the referred file from a referring file.
Primary Key ----> Key field
Virtual Key -----> Non Key field
e.g. OrderDetail Refers to Product.
8. Extended By
Declares a file to be extension of another file
It is recommended to use Extended by a relation along with Owned by relation. If used with OWNED BY realtion, the fields of the extended fiel are available as virtual fields in the file being extended.
e.g. Customer Extended by CustomerDetails.
NOTE:
Seqeuence order should be as follows
- OWNED BY,
- KNOWN BY,
- REFERS TO,
- HAS.
INVOLUTION: A file refers to itself. e.g. Manager Code is got from EMPLOYEE table, with refering to key field of Employee code, where manager code(employee code) can be taken for MANAGER CODE field.
e.g EMPLOYEE REFERS TO EMPLOYEE
FOR MANAGER CODE.
FOR Text: For text clause can be added to a relation to further clarify the description of a relationship. If a file refers to more than one file once,FOR text clause can be used for further clarification.
e.g. Order Refers to Customer
For : Ordering Sharing : *ALL
Order REFERS to Customer
For: Invocing Sharing:* ALL
Cardinality: It is way of mapping
One to One : Order---> Order Detail
One to many: Product --> Product Cxt
Many to many: Order ---> Product
Virtual Fields: Fields which would seem to be present in the file when specific relations are made, such that which will not be present in the related file as physically. Hence it is coined term Virtual field.
Have to take 'V' against the Owneb by and referes to relation.
Take 'Z2' to navigate to corresponding fields in the edit database relation panel.
Take 'Z' to enter in to the corresponding file.
