ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Data model editor / Logical Data Model
  • Overview
  • Creating a link
  • Notes
  • Owner data file and member data file
  • Referential integrity
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
The links are used to link the date files described in an analysis between themselves.
Several types of links are available. For more details, see Types of links.
Reminder: The terms "LDM" and "Analysis" are used interchangeably to define the structure of the database associated with a project.
Creating a link
To create a link:
  1. On the "Analysis" tab, in the "Creation" group, click "New link". The mouse cursor turns into a pen.
  2. Click the two data files that must be linked. The link description wizard opens automatically.
  3. To define the cardinalities between the two files:
    • select the desired cardinalities (0, 1; 1, 1; 0, N; 1, N).
    • answer the questions. The cardinalities will be automatically updated.
  4. To define the advanced cardinalities, check "Display advanced cardinalities" and answer the questions.
  5. Specify the link caption and briefly describe the purpose of the link. Go to the next step.
  6. Specify the keys to be linked. Go to the next step.
  7. Define the integrity rules. These rules ensure data integrity when one of the keys of the relationship is modified or deleted.
  8. Validate. The link is automatically created.
Remarks:
  • For more details on cardinalities, see Cardinalities.
  • 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 data file and member data file

When a link is defined between two data files, there is an Owner data file and a Member data file:
  • the owner data file is the owner of the key.
  • the member data file is a member of the analysis data files containing a copy of the key.
To set the link between two data files, the key of the owner data file is copied to the member data file.
For example, the key of the "Supplier" data file is copied to each record of the "Product" data file. Several records of the "Product" data file can have the same key of the "Supplier" data file:
  • "Supplier" is the owner data file,
  • "Product" is the member data file.
This type of link is represented as follows:

Referential integrity

Referential integrity in a database is a set of constraints that maintains consistency of data in a relationship between two data files.
Referential integrity checks that:
  • if a record is deleted from the owner data file, the matching records in the member data files are also deleted,
  • if a record is added to a member data file, there is a matching record in the owner data file,
  • if a record is updated in the owner file, the unique key doesn't change,
  • ...
The referential integrity is checked based on the nature of the link between the data files.
Related Examples:
WD Reflexive link Training (WINDEV): WD Reflexive link
[ + ] This example presents the management of a reflexive link with the WLanguage functions.
The following topics are presented in this example:
1/ Fill a control with HFSQL content (automatic management of reflexive link).
2/ Fill by programming.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/07/2025

Send a report | Local help