Previous Topic: Set Linkage for Index SetsNext Topic: Representing Relationships as Sets


Set Membership Options

Relationships can be optional or required. If a relationship is optional, an occurrence of the member record may or may not belong to an occurrence of the set that represents the relationship. Conversely, if a relationship is required, all occurrences of the member record type must belong to some occurrence of the set.

Set membership options control whether an occurrence of the member record type always belongs to an occurrence of the set. Membership options are specified as a pair of sub-options often referred to as disconnect/connect options.

The connect option of a set can be Automatic or Manual. If a set is defined as Automatic (A), then when an occurrence of the member record type is added to the database, it is automatically connected into an occurrence of the set. In contrast, record occurrences must be explicitly (programmatically) associated with an occurrence of a Manual (M) set.

The disconnect option controls when a member record can be removed from a set. If a set is defined as Mandatory (M), the only way to remove a member record from the set is to delete the record from the database. Member records of Optional (O) sets can be removed from the set without deleting the record.

In the Commonweather database, for example, the membership options of the DEPT-EMPLOYEE set are OPTIONAL/AUTOMATIC (OA). The Automatic option specifies that when an employee record is added to the database, it is automatically associated with the department in which the employee will work. The Optional option specifies that employee record occurrences can be transferred from one department (one set occurrence) to another without being deleted from the database.