company logo

Property definition

The property definition provides metadata for a property or value. Property definitions may also refer to extents, which are considered as property as well. A property definition provides a number of properties and access to subordinated elements

Properties

The property definition provides a number of properties, which are described in the class reference ( Reference documentation / ODABA application interface /Metadata classes / Property definition ). Properties might be read, but cannot be updated, since the property definition is part of the internal dictionary and cannot be updated by the application.

Besides schema properties, property definition provides derived (internal) data for the property definition.

Derived properties

Some of the properties are not directly defined in the schema definition, but are derived from the schema definition. Thus, functions like isTransientCollection() are combining several information in order to derive the requested information..

In addition, ...Count properties are provided in order to return the number of subordinated elements (e.g. supersetCount() ).

Property definition specializations

Several properties depend on the specialization of the property definition. When the property definition is an extent, one may request e.g. the property distinct , which will fail when being called for an ordinary property (e.g. attribute) of a structure. Property definition provides additional functions in order to determine the type of the property definition:

isAttribute() - property definition describes an attribute

isBaseType() - property definition describes a base type member

isReference() - property definition describes a reference property

isRelationship() - property definition describes a relationship

isExtent() - property definition describes an extent

In order to avoid exceptions, definition properties, which are available for specific property definitions should be checked before reading. Which properties are supported for specific property definition types is described in the class reference.

... fragment ( Property &person ) {

  PropertyDefinition  pd(person.propertyDefinition());

  if ( pd.isExtent() ) {

    if ( pd.subsetCount() > 0 )

      Application::output("Extend has got subsets");

    else

      Application::output("No subsets defined for extend");

  } else

    Application::output("Property does not support subsets");

}