Non-Feature Class Issues

FDO API

 
Non-Feature Class Issues
 
 
 

A non-feature class in FDO can be created as a stand-alone class, a contained class, or both. As a contained class, it defines a property of another class or feature class (see FdoFeatureClass and FdoClassType Global Enum). How this non-feature class is created affects the way the data is inserted, queried, and updated.

Stand-alone Class

This type of class stores non-feature data (for example, manufacturers). The FdoClassType_Class must be created with one or more identity properties (see FdoObjectPropertyDefinition), which is required in order that the class has a physical container (that is, a table in the RDBMS) associated with it. If the class is created without specifying an IdentityProperty, only the definition is stored in the metadata, which prevents any direct data inserts.

Contained Class

This type of class stores non-feature data that defines a property of another class or feature class (for example, Sidewalk could be a property of a Road feature class; the Sidewalk class defines the Road.Sidewalk property). In this case, the FdoClassType_Class does not need to be created with one or more identity properties, although it can be.

Class With IdentityProperty Used as ObjectProperty

This type of class reacts like a stand-alone class; however, with this type, it is possible to do direct data inserts. It can also be populated through a container class (for example, Road.Sidewalk) since it defines an object property (see FdoObjectPropertyDefinition). If this class is queried directly, only the data inserted into the class as a stand-alone is returned. The data associated with the ObjectProperty can only be queried through the container class (for example, Road.Sidewalk).

Class Without a Defined IdentityProperty Used as ObjectProperty

Because this class has no defined IdentityProperty, it can only be populated through the container class (for example, Road.Sidewalk) since it defines ObjectProperty. This class cannot be queried directly. The data associated with the object property can only be queried through the container class (for example, Road.Sidewalk). As an object property, it is defined as one of the following:

  • Value type property. Does not need any identifier since it has a one-to-one relationship with the container class.
  • Collection type property. Requires a local identifier, which is an identifier defined when creating the ObjectProperty object.
  • Ordered Collection type property. Requires a local identifier, which is an identifier defined when creating the ObjectProperty object.

When defining either a Collection or Ordered Collection type ObjectProperty, you must set an IdentityProperty attribute for that object property. This ObjectClass.IdentityProperty acts only as a local identifier compared to the IdentityProperty set at the class level. As a local identifier, it acts to uniquely identify each item within each collection (for example, if the local identifier for Road.Sidewalk is Side, there can be multiple sidewalks with Side=”Left” but only one per Road).

Describing a Schema

Use the FdoIDescribeSchema::Execute function to retrieve an FdoFeatureSchemaCollection in order to obtain any information about existing schema(s). The FdoFeatureSchemaCollection consists of all FdoFeatureSchemas in the data store and can be used to obtain information about any schema object, including FdoFeatureSchema, FdoClass, FdoFeatureClass, and their respective properties. The following functions return the main collections required to obtain information about all schema objects:

  • FdoFeatureSchema::GetClasses method obtains FdoClass and FdoFeatureClasses.
  • FdoClassDefinition::GetProperties method obtains a FdoPropertyDefinitionCollection.
  • FdoClassDefinition::GetBaseProperties method obtains a FdoPropertyDefinitionCollection of the properties inherited from the base classes.
NoteEven if your schema has no base classes (inheritance), all classes will inherit some properties from system classes.

Use these functions throughout the application to obtain any information about schema objects. For example, in order to insert data into a class, you must use these functions to determine what data type is required. Description of the data is separate from actions.

The example in the following link is a simple function that shows how to use FdoIDescribeSchema and loop through the schema and class containers to search for duplicate class names. It searches all schemas to ensure that the class name does not exist in any schema in the data store. Class names must be unique across the entire FDO database.

For a schema description example, see Example: Describing a Schema and Writing It to an XML File No label .

FDO Schema Element Class Diagram