Using object fields

Object fields are fields that represent a composite of other, simpler data types. These include ADT (Abstract Data Type) fields, Array fields, DataSet fields, and Reference fields. All of these field types either contain or reference child fields or other data sets.

ADT fields and array fields are fields that contain child fields. The child fields of an ADT field can be any scalar or object type (that is, any other field type). These child fields may differ in type from each other. An array field contains an array of child fields, all of the same type.

Dataset and reference fields are fields that access other data sets. A dataset field provides access to a nested (detail) dataset and a reference field stores a pointer (reference) to another persistent object (ADT).

Table 19.8 Types of object field components

Component name

Purpose

TADTField

Represents

an ADT (Abstract Data Type) field.

TArrayField

Represents

an array field.

TDataSetField

Represents

a field that contains a nested data set reference.

TReferenceField

Represents

a REF field, a pointer to an ADT.

When you add fields with the Fields editor to a dataset that contains object fields, persistent object fields of the correct type are automatically created for you. Adding persistent object fields to a dataset automatically sets the dataset's ObjectView property to True, which instructs the dataset to store these fields hierarchically, rather than flattening them out as if the constituent child fields were separate, independent fields.

The following properties are common to all object fields and provide the functionality to handle child fields and datasets.

Table 19.9 Common object field descendant properties

Property

Purpose

Fields

Contains the child fields belonging to the object field.

ObjectType

Classifies the object field.

FieldCount

Number of child fields belonging to the object field.

FieldValues

Provides access to the values of the child fields.

0 0

Post a comment