[fdo-commits] r2510 - in trunk: Fdo/Unmanaged/Src/Fdo/Schema Fdo/Unmanaged/Src/Message Providers/GenericRdbms/Src/UnitTest Providers/GenericRdbms/Src/UnitTest/Common Utilities/SchemaMgr/Inc/Sm/Lp Utilities/SchemaMgr/Src/Sm/Ph Utilities/SchemaMgr/Src/Sm/Ph/Rd

svn_fdo at osgeo.org svn_fdo at osgeo.org
Tue Feb 13 14:06:09 EST 2007


Author: brentrobinson
Date: 2007-02-13 14:06:08 -0500 (Tue, 13 Feb 2007)
New Revision: 2510

Modified:
   trunk/Fdo/Unmanaged/Src/Fdo/Schema/AssociationPropertyDefinition.cpp
   trunk/Fdo/Unmanaged/Src/Message/FDOMessage.mc
   trunk/Providers/GenericRdbms/Src/UnitTest/Common/SchemaMgrTests.cpp
   trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_MySql_master.txt
   trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_Oracle_master.txt
   trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer2005_master.txt
   trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer_master.txt
   trunk/Utilities/SchemaMgr/Inc/Sm/Lp/GeometricPropertyDefinition.h
   trunk/Utilities/SchemaMgr/Src/Sm/Ph/DependencyWriter.cpp
   trunk/Utilities/SchemaMgr/Src/Sm/Ph/Field.cpp
   trunk/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp
Log:
Merged from 3.2.x branch

Modified: trunk/Fdo/Unmanaged/Src/Fdo/Schema/AssociationPropertyDefinition.cpp
===================================================================
--- trunk/Fdo/Unmanaged/Src/Fdo/Schema/AssociationPropertyDefinition.cpp	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Fdo/Unmanaged/Src/Fdo/Schema/AssociationPropertyDefinition.cpp	2007-02-13 19:06:08 UTC (rev 2510)
@@ -346,13 +346,13 @@
     // Cannot create an association property without the associated class
     if( m_associatedClass == NULL )
     {
-        throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_55_ASSOCIATEDCLASSREQUIRED), GetName() ));
+        throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_55_ASSOCIATEDCLASSREQUIRED), (FdoString*) GetQualifiedName() ));
     }
 
     if( m_identityProperties && m_identityReverseProperties )
     {
         if( m_identityProperties->GetCount() != m_identityReverseProperties->GetCount() )
-            throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_17_ASSOCIATIONMISSMATCHERROR)));
+            throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_17_ASSOCIATIONMISSMATCHERROR), (FdoString*) GetQualifiedName() ));
         
         // Make sure that the identity properties and reverse properties are of the same types
         for( int i=0; i<m_identityProperties->GetCount(); i++ )
@@ -361,7 +361,7 @@
             FdoPtr<FdoDataPropertyDefinition> revprop = m_identityReverseProperties->GetItem( i );
             if( indprop->GetDataType() != revprop->GetDataType() )
             {
-                throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_17_ASSOCIATIONMISSMATCHERROR)));
+                throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_17_ASSOCIATIONMISSMATCHERROR), (FdoString*) GetQualifiedName() ));
             }
         }
 
@@ -373,7 +373,7 @@
                 FdoPtr<FdoDataPropertyDefinition> revprop = m_identityReverseProperties->GetItem( i );
                 if( revprop->GetIsAutoGenerated() || revprop->GetIsSystem() )
                 {
-                    throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_53_BADASSOCREVERSEPROP)));
+                    throw FdoSchemaException::Create(FdoException::NLSGetMessage(FDO_NLSID(SCHEMA_53_BADASSOCREVERSEPROP), (FdoString*) GetQualifiedName() ));
                 }
             }
         }

Modified: trunk/Fdo/Unmanaged/Src/Message/FDOMessage.mc
===================================================================
--- trunk/Fdo/Unmanaged/Src/Message/FDOMessage.mc	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Fdo/Unmanaged/Src/Message/FDOMessage.mc	2007-02-13 19:06:08 UTC (rev 2510)
@@ -159,7 +159,7 @@
 MessageId=1017
 SymbolicName=SCHEMA_17_ASSOCIATIONMISSMATCHERROR
 Language=English
-Type or number missmatch between the identity properties and the reverse identity properties. 
+Association Property '%1$ls' has type or number missmatch between the identity properties and the reverse identity properties. 
 .
 MessageId=1018
 SymbolicName=SCHEMA_18_ASSOCIATIONIDENTITYERROR
@@ -339,7 +339,7 @@
 MessageId=1053
 SymbolicName=SCHEMA_53_BADASSOCREVERSEPROP
 Language=English
-Cannot use auto-generated or system properties as reverse identity properties
+Cannot use auto-generated or system properties as reverse identity properties for association property '%1$ls'
 .
 MessageId=1054
 SymbolicName=SCHEMA_54_AUTOGENREADONLY

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/Common/SchemaMgrTests.cpp
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/Common/SchemaMgrTests.cpp	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/Common/SchemaMgrTests.cpp	2007-02-13 19:06:08 UTC (rev 2510)
@@ -184,7 +184,61 @@
         column = view2->CreateColumnDouble( L"DOUBLE_COLUMN", true, L"DOUBLE_COLUMN" );
         column = view2->CreateColumnGeom( L"GEOM_COLUMN", (FdoSmPhScInfo*) NULL, true, true, false, L"GEOM_COLUMN" );
 
+#ifndef RDBI_DEF_SSQL
+        table = owner->CreateTable( phMgr->GetDcDbObjectName(L"TABLE5" ));
+        column = table->CreateColumnDecimal( L"ID", false, 10, 2 );
+        table->AddPkeyCol( column->GetName() );
+        column = table->CreateColumnChar( L"STRING_COLUMN", false, 50 );
+
+        table = owner->CreateTable( phMgr->GetDcDbObjectName(L"RTABLE5" ));
+        column = table->CreateColumnDecimal( L"ID", false, 10, 2 );
+        table->AddPkeyCol( column->GetName() );
+        FdoSmPhColumnP fkeyColumn5 = table->CreateColumnDouble( L"TABLE5_ID", false );
+        column = table->CreateColumnChar( L"STRING_COLUMN", false, 50 );
+
+        fkey = table->CreateFkey( "FK_RTABLE5_TABLE5", phMgr->GetDcDbObjectName("TABLE5" ));
+        fkey->AddFkeyColumn( fkeyColumn5, L"ID" );
+
+        table = owner->CreateTable( phMgr->GetDcDbObjectName(L"TABLE6" ));
+        column = table->CreateColumnDecimal( L"ID1", false, 10, 2 );
+        table->AddPkeyCol( column->GetName() );
+        column = table->CreateColumnChar( L"ID2", false, 50 );
+        table->AddPkeyCol( column->GetName() );
+        column = table->CreateColumnChar( L"STRING_COLUMN", false, 50 );
+
+        table = owner->CreateTable( phMgr->GetDcDbObjectName(L"RTABLE6" ));
+        column = table->CreateColumnDecimal( L"ID", false, 10, 2 );
+        table->AddPkeyCol( column->GetName() );
+        FdoSmPhColumnP fkeyColumn6a = table->CreateColumnDouble( L"TABLE6_ID1", false );
+        FdoSmPhColumnP fkeyColumn6b = table->CreateColumnChar( L"TABLE6_ID2", false, 50 );
+        column = table->CreateColumnChar( L"STRING_COLUMN", false, 50 );
+
+        fkey = table->CreateFkey( "FK_RTABLE6_TABLE6", phMgr->GetDcDbObjectName("TABLE6" ));
+        fkey->AddFkeyColumn( fkeyColumn6a, L"ID1" );
+        fkey->AddFkeyColumn( fkeyColumn6b, L"ID2" );
+#endif
+
+        table = owner->CreateTable( phMgr->GetDcDbObjectName(L"TABLE7" ));
+        column = table->CreateColumnInt64( L"ID", false, true);
+        table->AddPkeyCol( column->GetName() );
+        column = table->CreateColumnChar( L"STRING_COLUMN", false, 50 );
+
+        table = owner->CreateTable( phMgr->GetDcDbObjectName(L"RTABLE7" ));
+        column = table->CreateColumnInt64( L"ID", false);
+        table->AddPkeyCol( column->GetName() );
+        FdoSmPhColumnP fkeyColumn7 = table->CreateColumnInt64( L"TABLE7_ID", false, true);
+        column = table->CreateColumnChar( L"STRING_COLUMN", false, 50 );
+
+        fkey = table->CreateFkey( "FK_RTABLE7_TABLE7", phMgr->GetDcDbObjectName("TABLE7" ));
+        fkey->AddFkeyColumn( fkeyColumn7, L"ID" );
+
+        FdoSmPhBatchColumnsP ukeys = table->GetUkeyColumns(); 
+        FdoSmPhColumnsP	ukeyColumns = new FdoSmPhColumnCollection();
+        ukeys->Add( ukeyColumns );
+    	table->AddUkeyCol( ukeys->GetCount() - 1, L"TABLE7_ID" );
+
         database->Commit();
+        
         owner->DiscardDbObject(table);
         // Make sure RTABLE2 got removed from the not found list.
         CPPUNIT_ASSERT( owner->FindDbObject(phMgr->GetDcDbObjectName(L"RTABLE2")) != NULL );

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_MySql_master.txt
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_MySql_master.txt	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_MySql_master.txt	2007-02-13 19:06:08 UTC (rev 2510)
@@ -110,6 +110,155 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="rtable5" type="AutoGen:rtable5Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="rtable5Key">
+<xs:selector xpath=".//rtable5"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="rtable5Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE5_ID">
+<xs:simpleType>
+<xs:restriction base="xs:double"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="rtable6" type="AutoGen:rtable6Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="rtable6Key">
+<xs:selector xpath=".//rtable6"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="rtable6Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE6_ID1">
+<xs:simpleType>
+<xs:restriction base="xs:double"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="TABLE6_ID2">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="rtable7" type="AutoGen:rtable7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="rtable7Key">
+<xs:selector xpath=".//rtable7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+<xs:unique name="rtable7Key_0">
+<xs:selector xpath=".//rtable7"/>
+<xs:field xpath="TABLE7_ID"/>
+</xs:unique>
+</xs:element>
+<xs:complexType name="rtable7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE7_ID" fdo:readOnly="true" fdo:autogenerated="true">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 <xs:element name="table1" type="AutoGen:table1Type" abstract="false" substitutionGroup="gml:_Feature">
 <xs:key name="table1Key">
 <xs:selector xpath=".//table1"/>
@@ -596,5 +745,127 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="table5" type="AutoGen:table5Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="table5Key">
+<xs:selector xpath=".//table5"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="table5Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="table6" type="AutoGen:table6Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="table6Key">
+<xs:selector xpath=".//table6"/>
+<xs:field xpath="ID1"/>
+<xs:field xpath="ID2"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="table6Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID1">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="ID2">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="table7" type="AutoGen:table7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="table7Key">
+<xs:selector xpath=".//table7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="table7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 </xs:schema>
 </fdo:DataStore>

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_Oracle_master.txt
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_Oracle_master.txt	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_Oracle_master.txt	2007-02-13 19:06:08 UTC (rev 2510)
@@ -264,6 +264,185 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="RTABLE5" type="AutoGen:RTABLE5Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="RTABLE5Key">
+<xs:selector xpath=".//RTABLE5"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="RTABLE5Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE5_ID">
+<xs:simpleType>
+<xs:restriction base="xs:double"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="RTABLE6" type="AutoGen:RTABLE6Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="RTABLE6Key">
+<xs:selector xpath=".//RTABLE6"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="RTABLE6Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE6_ID1">
+<xs:simpleType>
+<xs:restriction base="xs:double"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="TABLE6_ID2">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="RTABLE7" type="AutoGen:RTABLE7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="RTABLE7Key">
+<xs:selector xpath=".//RTABLE7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+<xs:unique name="RTABLE7Key_0">
+<xs:selector xpath=".//RTABLE7"/>
+<xs:field xpath="TABLE7_ID"/>
+</xs:unique>
+</xs:element>
+<xs:complexType name="RTABLE7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="FK_RTABLE7_TABLE7" minOccurs="0" maxOccurs="1" fdo:multiplicity="" fdo:deleteRule="Break" fdo:defaultIdentity="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexType>
+<xs:sequence>
+<xs:element name="TABLE7_ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="20"/>
+<xs:fractionDigits value=""/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:complexType>
+<xs:keyref name="AutoGen_RTABLE7_FK_RTABLE7_TABLE7" refer="AutoGen:TABLE7_RTABLE7AKey">
+<xs:selector xpath=".//RTABLE7"/>
+<xs:field xpath="ID"/>
+</xs:keyref>
+</xs:element>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="20"/>
+<xs:fractionDigits value=""/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE7_ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="20"/>
+<xs:fractionDigits value=""/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 <xs:element name="TABLE1" type="AutoGen:TABLE1Type" abstract="false" substitutionGroup="gml:_Feature">
 <xs:key name="TABLE1Key">
 <xs:selector xpath=".//TABLE1"/>
@@ -546,6 +725,135 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="TABLE5" type="AutoGen:TABLE5Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="TABLE5Key">
+<xs:selector xpath=".//TABLE5"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="TABLE5Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="TABLE6" type="AutoGen:TABLE6Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="TABLE6Key">
+<xs:selector xpath=".//TABLE6"/>
+<xs:field xpath="ID1"/>
+<xs:field xpath="ID2"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="TABLE6Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID1">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="10"/>
+<xs:fractionDigits value="2"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="ID2">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
+<xs:element name="TABLE7" type="AutoGen:TABLE7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="TABLE7Key">
+<xs:selector xpath=".//TABLE7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+<xs:key name="TABLE7_RTABLE7AKey">
+<xs:selector xpath=".//AutoGen"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="TABLE7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:decimal">
+<xs:totalDigits value="20"/>
+<xs:fractionDigits value=""/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 <xs:element name="VERTABLE1" type="AutoGen:VERTABLE1Type" abstract="false" substitutionGroup="gml:_Feature">
 <xs:key name="VERTABLE1Key">
 <xs:selector xpath=".//VERTABLE1"/>

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer2005_master.txt
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer2005_master.txt	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer2005_master.txt	2007-02-13 19:06:08 UTC (rev 2510)
@@ -186,6 +186,53 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="rtable7" type="dbo:rtable7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="rtable7Key">
+<xs:selector xpath=".//rtable7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+<xs:unique name="rtable7Key_0">
+<xs:selector xpath=".//rtable7"/>
+<xs:field xpath="TABLE7_ID"/>
+</xs:unique>
+</xs:element>
+<xs:complexType name="rtable7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE7_ID" fdo:readOnly="true" fdo:autogenerated="true">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 <xs:element name="table1" type="dbo:table1Type" abstract="false" substitutionGroup="gml:_Feature">
 <xs:key name="table1Key">
 <xs:selector xpath=".//table1"/>
@@ -595,6 +642,41 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="table7" type="dbo:table7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="table7Key">
+<xs:selector xpath=".//table7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="table7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 </xs:schema>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fdo.osgeo.org/schemas/feature/guest" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:gml="http://www.opengis.net/gml" xmlns:guest="http://fdo.osgeo.org/schemas/feature/guest" elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:annotation>
@@ -1660,6 +1742,9 @@
 <complexType name="rtable2Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
 <Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_rtable2" name="dbo.rtable2"/>
 </complexType>
+<complexType name="rtable7Type" identityIsGloballyUnique="false" identitySeed="1" identityIncrement="1" identityPropertyName="TABLE7_ID">
+<Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_rtable7" name="dbo.rtable7"/>
+</complexType>
 <complexType name="table1Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
 <Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_table1" name="dbo.table1"/>
 </complexType>
@@ -1669,6 +1754,9 @@
 <complexType name="table4Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
 <Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_table4" name="dbo.table4"/>
 </complexType>
+<complexType name="table7Type" identityIsGloballyUnique="false" identitySeed="1" identityIncrement="1" identityPropertyName="ID">
+<Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_table7" name="dbo.table7"/>
+</complexType>
 </SchemaMapping>
 <SchemaMapping xmlns:rdb="http://fdordbms.osgeo.org/schemas" xmlns="http://www.autodesk.com/isd/fdo/SqlServerProvider" textInRow="NotInRow" provider="Autodesk.SqlServer.3.2" name="guest">
 <complexType name="vertable1Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">

Modified: trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer_master.txt
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer_master.txt	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/gen_default1_SqlServer_master.txt	2007-02-13 19:06:08 UTC (rev 2510)
@@ -186,6 +186,53 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="rtable7" type="dbo:rtable7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="rtable7Key">
+<xs:selector xpath=".//rtable7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+<xs:unique name="rtable7Key_0">
+<xs:selector xpath=".//rtable7"/>
+<xs:field xpath="TABLE7_ID"/>
+</xs:unique>
+</xs:element>
+<xs:complexType name="rtable7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+<xs:element name="TABLE7_ID" fdo:readOnly="true" fdo:autogenerated="true">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 <xs:element name="table1" type="dbo:table1Type" abstract="false" substitutionGroup="gml:_Feature">
 <xs:key name="table1Key">
 <xs:selector xpath=".//table1"/>
@@ -595,6 +642,41 @@
 </xs:extension>
 </xs:complexContent>
 </xs:complexType>
+<xs:element name="table7" type="dbo:table7Type" abstract="false" substitutionGroup="gml:_Feature">
+<xs:key name="table7Key">
+<xs:selector xpath=".//table7"/>
+<xs:field xpath="ID"/>
+</xs:key>
+</xs:element>
+<xs:complexType name="table7Type" abstract="false">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:complexContent>
+<xs:extension base="fdo:ClassType">
+<xs:sequence>
+<xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+<xs:simpleType>
+<xs:restriction base="fdo:int64"/>
+</xs:simpleType>
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+</xs:element>
+<xs:element name="STRING_COLUMN">
+<xs:annotation>
+<xs:documentation/>
+</xs:annotation>
+<xs:simpleType>
+<xs:restriction base="xs:string">
+<xs:maxLength value="50"/>
+</xs:restriction>
+</xs:simpleType>
+</xs:element>
+</xs:sequence>
+</xs:extension>
+</xs:complexContent>
+</xs:complexType>
 </xs:schema>
 <SchemaMapping xmlns:rdb="http://fdordbms.osgeo.org/schemas" xmlns="http://www.autodesk.com/isd/fdo/SqlServerProvider" textInRow="NotInRow" provider="Autodesk.SqlServer.3.2" name="dbo">
 <complexType name="rtable1Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
@@ -603,6 +685,9 @@
 <complexType name="rtable2Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
 <Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_rtable2" name="dbo.rtable2"/>
 </complexType>
+<complexType name="rtable7Type" identityIsGloballyUnique="false" identitySeed="1" identityIncrement="1" identityPropertyName="TABLE7_ID">
+<Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_rtable7" name="dbo.rtable7"/>
+</complexType>
 <complexType name="table1Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
 <Table tableFilegroup="PRIMARY" textFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_table1" name="dbo.table1"/>
 </complexType>
@@ -612,5 +697,8 @@
 <complexType name="table4Type" identityIsGloballyUnique="false" identitySeed="0" identityIncrement="0" identityPropertyName="">
 <Table tableFilegroup="PRIMARY" textFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_table4" name="dbo.table4"/>
 </complexType>
+<complexType name="table7Type" identityIsGloballyUnique="false" identitySeed="1" identityIncrement="1" identityPropertyName="ID">
+<Table tableFilegroup="PRIMARY" textInRow="NotInRow" pkeyName="pk_dbo_table7" name="dbo.table7"/>
+</complexType>
 </SchemaMapping>
 </fdo:DataStore>

Modified: trunk/Utilities/SchemaMgr/Inc/Sm/Lp/GeometricPropertyDefinition.h
===================================================================
--- trunk/Utilities/SchemaMgr/Inc/Sm/Lp/GeometricPropertyDefinition.h	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Utilities/SchemaMgr/Inc/Sm/Lp/GeometricPropertyDefinition.h	2007-02-13 19:06:08 UTC (rev 2510)
@@ -173,25 +173,25 @@
 	FdoString* GetRootColumnNameSi1() const;
 	const FdoSmPhColumn* RefColumnSi1() const;
     FdoSmPhColumnP GetColumnSi1();
-    bool GetIsFixedColumnSi1() const { return mbFixedColumnSi1; }
-    bool GetIsColumnCreatorSi1() const { return mbColumnCreatorSi1; }
+    // SI column fixed name and FDO ownership status not tracked in MetaSchema.
+    // However, these are in lock step with equivalent statuses for geometric column.
+    bool GetIsFixedColumnSi1() const { return GetIsFixedColumn(); }
+    bool GetIsColumnCreatorSi1() const { return GetIsColumnCreator(); }
 	void SetColumnNameSi1( FdoString* columnName );
 	void SetRootColumnNameSi1( FdoString* columnName );
 	void SetColumnSi1( FdoSmPhColumnP pColumn );
-    void SetIsFixedColumnSi1( bool bFixedColumn ) { mbFixedColumnSi1 = bFixedColumn; }
-    void SetIsColumnCreatorSi1( bool bColumnCreator ) { mbColumnCreatorSi1 = bColumnCreator; }
 
 	FdoString* GetColumnNameSi2() const;
 	FdoString* GetRootColumnNameSi2() const;
 	const FdoSmPhColumn* RefColumnSi2() const;
     FdoSmPhColumnP GetColumnSi2();
-    bool GetIsFixedColumnSi2() const { return mbFixedColumnSi2; }
-    bool GetIsColumnCreatorSi2() const { return mbColumnCreatorSi2; }
+    // SI column fixed name and FDO ownership status not tracked in MetaSchema.
+    // However, these are in lock step with equivalent statuses for geometric column.
+    bool GetIsFixedColumnSi2() const { return GetIsFixedColumn(); }
+    bool GetIsColumnCreatorSi2() const { return GetIsColumnCreator(); }
 	void SetColumnNameSi2( FdoString* columnName );
 	void SetRootColumnNameSi2( FdoString* columnName );
 	void SetColumnSi2( FdoSmPhColumnP pColumn );
-    void SetIsFixedColumnSi2( bool bFixedColumn ) { mbFixedColumnSi2 = bFixedColumn; }
-    void SetIsColumnCreatorSi2( bool bColumnCreator ) { mbColumnCreatorSi2 = bColumnCreator; }
 
     //////////////////////////////////////////////////////////////////////
 
@@ -396,15 +396,11 @@
     FdoStringP mRootColumnNameSi1;
     FdoStringP mCandRootColumnNameSi1;
 	FdoSmPhColumnP mColumnSi1;
-    bool mbFixedColumnSi1;
-    bool mbColumnCreatorSi1;
 
 	FdoStringP mColumnNameSi2;
     FdoStringP mRootColumnNameSi2;
     FdoStringP mCandRootColumnNameSi2;
 	FdoSmPhColumnP mColumnSi2;
-    bool mbFixedColumnSi2;
-    bool mbColumnCreatorSi2;
 };
 
 typedef FdoPtr<FdoSmLpGeometricPropertyDefinition> FdoSmLpGeometricPropertyP;

Modified: trunk/Utilities/SchemaMgr/Src/Sm/Ph/DependencyWriter.cpp
===================================================================
--- trunk/Utilities/SchemaMgr/Src/Sm/Ph/DependencyWriter.cpp	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Utilities/SchemaMgr/Src/Sm/Ph/DependencyWriter.cpp	2007-02-13 19:06:08 UTC (rev 2510)
@@ -99,7 +99,7 @@
 
 void FdoSmPhDependencyWriter::SetCardinality(long lValue)
 {
-	SetDouble(L"",L"fkcardinality", lValue);
+	SetLong(L"",L"fkcardinality", lValue);
 }
 
 void FdoSmPhDependencyWriter::Modify( FdoStringP pkTableName, FdoStringP fkTableName )

Modified: trunk/Utilities/SchemaMgr/Src/Sm/Ph/Field.cpp
===================================================================
--- trunk/Utilities/SchemaMgr/Src/Sm/Ph/Field.cpp	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Utilities/SchemaMgr/Src/Sm/Ph/Field.cpp	2007-02-13 19:06:08 UTC (rev 2510)
@@ -130,7 +130,6 @@
             // no default value, just select by qualified name. 
 
             selectSyntax = GetQName();
-
         }
         else { 
             // default value, generate syntax for a function that
@@ -147,8 +146,9 @@
     else {
         // column does not exist.
         // return the default value as a literal plus an alias (the field name).
+
         selectSyntax = FdoStringP(L"(") + 
-            GetManager()->FormatSQLVal(mDefaultValue, pColumn->GetType()) + L") \"" + GetName() + L"\"";
+            GetManager()->FormatSQLVal(mDefaultValue, pColumn->GetType()) + L") as \"" + GetName() + L"\"";
     }
 
     return selectSyntax;
@@ -159,7 +159,7 @@
     FdoStringP colSyntax;
 
     if ( GetColumn() ) {
-        colSyntax = GetName();
+        colSyntax = GetColumn()->GetName();
     }
 
     return colSyntax;

Modified: trunk/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp
===================================================================
--- trunk/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp	2007-02-13 18:17:50 UTC (rev 2509)
+++ trunk/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp	2007-02-13 19:06:08 UTC (rev 2510)
@@ -302,24 +302,44 @@
 bool FdoSmPhRdPropertyReader::CheckFkey( FdoSmPhFkeyP fkey )
 {
     FdoInt32 idx;
-    FdoSmPhColumnP column;
+    FdoSmPhColumnP fkeyColumn;
+    FdoSmPhColumnP pkeyColumn;
 
     FdoSmPhColumnsP fkeyColumns = fkey->GetFkeyColumns();
+    FdoSmPhColumnsP pkeyColumns = fkey->GetPkeyColumns();
 
+    if ( fkeyColumns->GetCount() != pkeyColumns->GetCount() ) 
+        // This would be a malformed foreign key so skip it.
+        return false;
+
     for ( idx = 0; idx < fkeyColumns->GetCount(); idx++ ) {
-        column = fkeyColumns->GetItem( idx );
+        fkeyColumn = fkeyColumns->GetItem( idx );
 
-        if ( !CheckColumn(column) )
+        if ( !CheckColumn(fkeyColumn) )
+            // Skipping fkey column so skip entire foreign key
             return false;
-    }
 
-    FdoSmPhColumnsP pkeyColumns = fkey->GetPkeyColumns();
+        pkeyColumn = pkeyColumns->GetItem( idx );
 
-    for ( idx = 0; idx < pkeyColumns->GetCount(); idx++ ) {
-        column = pkeyColumns->GetItem( idx );
+        if ( !CheckColumn(pkeyColumn) )
+            // Skipping pkey column so skip entire foreign key
+            return false;
 
-        if ( !CheckColumn(column) )
+        if ( fkeyColumn->GetType() != pkeyColumn->GetType() ) 
+            // FDO does not support association properties whose corresponding
+            // identity property pairs aren't of the same type. This foreign key
+            // generates such an association property so skip it. 
             return false;
+
+        if ( fkeyColumn->GetType() == FdoSmPhColType_Geom ) 
+            // FDO Association property does not support geometric properties as identity properties
+            return false;
+
+        if ( fkeyColumn->GetAutoincrement() ) 
+            // Association reverse identity properties cannot be autogenerated so skip
+            // foreign keys with autogenerated fkey columns.
+            return false;
+
     }
 
     return true;



More information about the fdo-commits mailing list