Base Schema Examples
Overview
You cannot change the base Schema of a DD and the implicitly generated attributes and relations, but it is useful to know it. The base Schema is important as you can reference all attributes or relations in the Schema by your ASQL queries, sometimes you rely on them to perform your tasks.
Every DD that is used in a CI always has a column "Expression-ObjectID"; this column always contains the unique identifier of the CI. It is a computed column and cannot be changed but you can use it in ASQL. This column is the base for the ASQL T-operator functionality.
To show the different CI and DD layouts in the DB we use the following examples. Every DD in the examples has only one attribute called Name, so all other columns in the DB are created implicit. Every DD is included in 2 CIs (KBExampleCI and KBExampleSimpleCI), one of the CIs is based on a "Simple CI Base" DD.
DD Table Layouts
CustomClass
A custom DD that is included in CIs always has columns with this name pattern "UsedInType<CI name>". In our example you see 2 of these columns for the 2 CIs containing this DD. One of these columns contains the ID of the CI, the others are null. The ID column is different from the UsedInType... columns.
CommonClass
A common DD has one UsedInType column containing the ID of the CI and a TypeID column containing the Schema ID of the CI. The ID column is different from the UsedInType column.
The Schema ID is a unique identifier for a CI, you can find it on the advanced tab of a CI Schema Dialog.
SimpleCommonClass
A simple common class DD has the same column layout as a common class. The only difference is that the UsedInType column is a Computed column, it is equal to the ID column. The ID column is equal to the CI ID.
SimpleCiBase
A simple CI base DD is similar to a common class, but it has no UsedInType column, the ID column is the identifier of the CI and the DD.
The hidden CI table
The type table of a CI contains only the ID of the CI.
Sample Data
We create sample data for the 2 CIs, one instance for each CI. You see here the data directly selected from the database.
The colored Guids are the IDs of the CI instances.
KBExampleCI
KBExampleSimpleCiBaseClass
KBExampleCustomClass
KBExampleCommonClass
KBExampleSimpleCommonClass