PC SOFT

WINDEV的在线文档

  • Overview
  • Creating a link
  • Notes
  • Owner file and member file
  • Referential integrity
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The links are used to link the date files described in an analysis among themselves.

Several types of links are available. See Types of links for more details.

Reminder: The "LDM" and "Analysis" terms are indifferently used to define the structure of the database associated with a project.

Creating a link
To create a link:
  1. Select "Insert .. Link". The mouse cursor turns into a pen.On the "数据模型" pane, in the "创建" group, click "新建链接". The mouse cursor turns into a pen.
  2. Click the two data files that must be linked. The wizard for link description is automatically opened.
  3. To define the cardinalities between the two files:
    • select the cardinalities among the proposed ones (0,1 ; 1,1 ; 0,N ; 1,N).
    • answer the questions asked. The cardinalities will be automatically updated.
  4. To describe the advanced cardinalities, check "Display the advanced cardinalities" and answer the questions asked.
  5. Enter the caption of the link by briefly describing the purpose of the link. Go to the next step.
  6. Specify the keys to link. Go to the next step.
  7. Specify the integrity rules. These rules are used to ensure the data integrity when one of the relation keys is modified or deleted.
  8. Validate. The link is automatically created.
Notes:
  • See Cardinalities for more details.
  • 16版本和更高版本
    If the data files to link contain an identical unique composite key (and also contain the items included in the composite key), a link can be performed on this composite key.
    16新版本
    If the data files to link contain an identical unique composite key (and also contain the items included in the composite key), a link can be performed on this composite key.
    If the data files to link contain an identical unique composite key (and also contain the items included in the composite key), a link can be performed on this composite key.

Notes

Owner file and member file

When a link is defined between two data files, an owner file and a member file are found:
  • the owner file is the owner of the key.
  • the member file is a member of the analysis files containing a copy of the key.
To manage the link between two data files, the key of the owner file is copied into the member file.

For example, the key of "Supplier" file is copied into each record of "Product" file. Several records of "Product" file can have the same key of "Supplier" file:

  • the owner file is "Supplier",
  • the member file is "Product".
This type of link is represented as follows:

Referential integrity

The referential integrity of a database corresponds to the respect of constraints implied by the links between the data files.

The referential integrity consists in checking that:

  • if a record is deleted from the owner file, the corresponding records are also deleted from the member files,
  • if a record is added into a member file, a corresponding record exists in the owner file,
  • if a record is modified in the owner file, the unique key is not modified,
  • ...
The check of referential integrity depends on the nature of the link between the data files.