ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Data model editor / Logical Data Model
  • Overview
  • Parallel link
  • Definition
  • Remarks
  • Optional link
  • Definition
  • Complement link
  • Definition
  • Shared link
  • Definition
  • Shared link with a 0,N - 0,1 cardinality
  • Shared link with a 0,N - 1,1 cardinality
  • Shared link with a 1,N - 0,1 cardinality
  • Shared link with a 1,N - 1,1 cardinality
  • Complex link
  • Definition
  • Example of complex link
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
Several types of links can exist between the data files:
Parallel link

Definition

For a parallel link, each record found in a data file ("Product") is linked to a record found in another data file ("Info"), and conversely.
To manage a parallel link, the identifier of the "Product" data file is copied into the "Info" data file. This identifier is also a unique key in the "Info" data file.
The "Product" data file is the owner file. The "Info" data file is the member file.

Remarks

  • This type of link is rare because the two data files can be grouped into a single file.
  • The parallelism of records in the data file is respected if the following operations are run simultaneously on the two data files:
    • creating a record
    • deleting a record
    • reindexing with compression
Optional link

Definition

For an optional link, each record found in a data file ("Category") is associated with no record or with a single record in another data file ("Group"). Each record of the other data file ("Group") is associated with no record or with a single record in the first data file ("Category").
An optional link is performed by copying the identifier of each data file into the other data file.
Complement link

Definition

For a complement link, each record found in a data file ("Product") is associated with no record or with a single record in another data file ("Details"). Each record of the other data file ("Details") is necessarily associated with a record in the first data file ("Product").
Complement links are quite common. They are used when a record can have additional optional information.
To manage a complement link, the key of the "Product" data file is copied into the "Details" data file. To ensure the maximum cardinality of 1, it remains a unique key. Since this key is unique, it is not possible to insert more than one record in "Details" for a record in "Product".
The owner file is "Product", the member file is "Details".
Shared link

Definition

For a shared link, the same record in a data file ("Supplier") can be shared by several records in another data file ("Product").
To manage a shared link, the key of the "Supplier" data file is copied into the "Product" data file. It becomes a multiple key to optimize the speed of the integrity check.
The owner file is "Supplier", the member file is "Product".
Depending on the cardinality, we can distinguish between four types of shared links:
  • Shared link with a 0,n - 0,1 cardinality
  • Shared link with a 0,n - 1,1 cardinality
  • Shared link with a 1,n - 0,1 cardinality
  • Shared link with a 1,n - 1,1 cardinality

Shared link with a 0,N - 0,1 cardinality

With this type of link:
  • an owner may have no member (a supplier does not necessarily have a product).
  • a member may have no owner (a product does not necessarily have a supplier).

Shared link with a 0,N - 1,1 cardinality

With this type of link:
  • an owner may have no member (a supplier may have no product).
  • each member has a single owner (each product has a single supplier).
Remark: This type of link is quite common. WINDEV allows you to automatically create the windows used to manage the data files linked by a 0,N - 1,1 link.

Shared link with a 1,N - 0,1 cardinality

With this type of link:
  • each owner has at least one member (a supplier has at least one product).
  • a member may have no owner (a product may have no supplier).

Shared link with a 1,N - 1,1 cardinality

With this type of link:
  • each owner has at least one member (each supplier has at least one product).
  • each member has a single owner (each product has a single supplier).
Complex link

Definition

For a "complex" link, you must manage a link file called relation file.
The relationship file will be automatically created. It will contain a unique key that includes the two keys of the related data files.
The relationship file can also contain information specific to the link.
A complex link includes two shared links.

Example of complex link

An order ("Orders" file) can contain one or more products. A product ("Product" file) can be used in several orders.
In this case, a link file is required ("OrderLine" file).
The "OrderLine" file contains:
  • a unique key containing the keys of Product and Orders.
  • the number of products ordered.
The links between the files are as follows:
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: 06/22/2023

Send a report | Local help