[fdo-users] Question on accessing Schema Mappings

Brent Robinson brent.robinson at autodesk.com
Tue Jul 24 08:12:43 EDT 2007


Hi Maksim,

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.
FdoIDescribeSchemaMapping 
	returns an FdoPhysicalSchemaMappingCollection, which has an 
	FdoPhysicalSchemaMapping for each feature schema in your
datastore. 	
	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
derivation. For 
	SqlServer it can be cast to FdoSqlServerOvPhysicalSchemaMapping.
If you're
	Working from the FDO source code, the header for this class is
in 
	
Providers\GenericRdbms\Inc\Rdbms\Override\SqlServer\SqlServerOvPhysicalS
chemaMapping.h
	and the required DLL's are SqlServerOverrides.dll and
RdbmsOverrides.dll

	- From FdoSqlServerOvPhysicalSchemaMapping, you can get the list
of classes 
	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.

Brent.

-----Original Message-----
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


Dear all,

I established Microsoft SQL Server hosted DataStore with several
FeatureSchemas, containing several FeatureClasses, containing several
Properties. Actual data was instantiated on all beforementioned
elements,
everything works OK.

During model creation provider imposes implicit SchemaMappings on
several
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
column
names carry mapped names (e.g. DataPropertyDefintion named "Number" gets
mapped to a column named "number1"). I've noticed that every schema
mapping
gets persisted within dbo.f_attributedefinition table.

Now for the question - how do I gain access to (auto)generated mappings
on
model elements - Schema, Class and Property? What's the procedure to get
i.e. PropertyDefinition for given ISQLDataReader column name (or
vice-versa)?

Regards,
Maksim Sestic


-- 
View this message in context:
http://www.nabble.com/Question-on-accessing-Schema-Mappings-tf4128750s18
162.html#a11741028
Sent from the fdo-users mailing list archive at Nabble.com.

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users



More information about the fdo-users mailing list