[fdo-users] Question on accessing Schema Mappings
brent.robinson at autodesk.com
Tue Jul 24 08:12:43 EDT 2007
Are you using the FDO API?
If you are, the schema mappings can be retrieved by the following steps:
- create and execute a DescribeSchemaMapping command.
returns an FdoPhysicalSchemaMappingCollection, which has an
FdoPhysicalSchemaMapping for each feature schema in your
FdoPhysicalSchemaMapping, in itself, provides very little
information, since the
schema mappings are different for each type or provider.
- cast each FdoPhysicalSchemaMapping to its provider-specific
SqlServer it can be cast to FdoSqlServerOvPhysicalSchemaMapping.
Working from the FDO source code, the header for this class is
and the required DLL's are SqlServerOverrides.dll and
- From FdoSqlServerOvPhysicalSchemaMapping, you can get the list
For this schema and, from each class, its list of properties.
Each property has
a column object that indicates the corresponding column name.
The handling of default mappings ( column name same as property name )
depends on the IncludeDefaults setting on the FdoIDescribeSchemaMapping.
If true, all properties and their column mappings are listed. If false,
only properties, where property and column name different are present.
An alternative to the above is to run the query using the FdoISelect
command. This command takes property names and automatically handles the
translation to column names when it runs the query against the RDBMS.
However, FdoISelect does not provide full SQL functionality, so there
are cases where you'll need to use ISQLDataReader.
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Maksim Sestic
Sent: Monday, July 23, 2007 6:06 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] Question on accessing Schema Mappings
I established Microsoft SQL Server hosted DataStore with several
FeatureSchemas, containing several FeatureClasses, containing several
Properties. Actual data was instantiated on all beforementioned
everything works OK.
During model creation provider imposes implicit SchemaMappings on
PropertyDefinitions, which is OK during data insertion. Querying data
introduces problems since ISQLDataReader takes actual column name as a
parameter to get access to stored property value. In certain cases
names carry mapped names (e.g. DataPropertyDefintion named "Number" gets
mapped to a column named "number1"). I've noticed that every schema
gets persisted within dbo.f_attributedefinition table.
Now for the question - how do I gain access to (auto)generated mappings
model elements - Schema, Class and Property? What's the procedure to get
i.e. PropertyDefinition for given ISQLDataReader column name (or
View this message in context:
Sent from the fdo-users mailing list archive at Nabble.com.
fdo-users mailing list
fdo-users at lists.osgeo.org
More information about the fdo-users