Creating a Schema
The following basic steps are required to create
a schema (some steps are optional; some may be done in an alternate
order to achieve the same result):
- Use
the FdoFeatureSchema::Create(“SchemaName”, “FeatureSchema Description”)
method to create a schema.
- Use
the FdoFeatureSchema::GetClasses() method to return a class collection.
- Use
the FdoClass::Create(“className”, “classDescription”) or FdoFeatureClass::Create(“className”,
“classDescription”) method to create FdoClass or FdoFeatureClass
type objects.
- Use
the FdoClassCollection::Add(class) method to add FdoClass or FdoFeatureClass
objects to the class collection.
- Use
the FdoGeometricPropertyDefinition::Create(“name”, “Description”)
method to create FdoGeometryProperty.
- Use
the FdoDataPropertyDefinition::Create(“name”, “Description”) method
to create FdoDataProperty.
- Use
the FdoObjectPropertyDefinition::Create(“name”, “Description”) method
to create FdoObjectProperty.
- Use
the FdoClassDefinition::GetProperties() and Add(property) methods
to add property to class definition.
- Use
the FdoIApplySchemaCommand::SetFeatureSchema(feature schema) method
to set the schema object for the IFdoApplySchemaCommand.
- Use
the FdoAssociationPropertydefinition class to represent the association
between two classes. The class of the associated class must already
be defined in the feature schema and cannot be abstract.
- Use
the FdoIApplySchemaCommand::Execute() method to execute changes
to the feature schema.
For an example of schema creation, see Example: Creating a Feature Schema.
Use the FdoClassDefinition::GetIdentityProperties()
and Add(Property Object) methods to set the property as FdoClass
or FdoFeatureClass Identifier. FDO allows multiple Identifiers for
both types of classes, although Identifiers have slight differences
in both cases.