What are supertypes and subtypes?
A subtype is a type that shares characteristics with another type (its supertype), but that also has one or more characteristics of its own.
How to define a subtype table
To define a subtype table:
Subtype indicators
For each subtype table you define, USoft automatically creates a subtype indicator column in the supertype table. A subtype indicator is a Yes/No flag that indicates, for each subtype, if a given supertype instance (a supertype record) is also of the subtype.
Selecting subtype data
In the SQL statements you write, you may refer to a subtype as if it were a separate table. From a subtype, you can select:
Inserting supertype and subtype data
Whenever you insert supertype or subtype data, this affects the entire record constellation (the supertype data and all corresponding subtype data).
Updating supertype and subtype data
Existing supertype-subtype record constellations may be updated in three ways:
Deleting supertype and subtype data
Whenever you delete supertype or subtype data, this affects the entire record constellation (the supertype data and all corresponding subtype data).
Relationship Inheritance from supertype to subtype (RELATE)
If you have defined a relationship between a supertype and another table, you can join any subtypes to that other table using the same relationship.
Constraints on supertypes and subtypes
When you write constraint statements on a supertype table, you can refer to:
Transitional constraints on supertypes and subtypes
When you use a subtype table in a transitional constraint, the conditions under which the constraint are evaluated require special attention.
GUI implementation of subtypes
By default, if your application has a USoft-generated UI, then USoft Definer generates separate windows or web pages for a supertype and also for each of its subtypes.
Designing subtypes successfully
This help topic contains tips for good design of subtypes.
Subtype definitions
Some supertypes are categorised using multiple schemes. Each categorisation scheme results in a group of subtypes. For example, branches of a car rental organisation could be categorised by owner (depending on whether the branch is owned or leased by the branch organisation) and, alternatively, by location.