[fdo-commits] r762 - branches/3.2.x/Utilities/SchemaMgr/Src/Sm/Ph/Rd
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Mon Feb 12 13:15:24 EST 2007
Author: brentrobinson
Date: 2007-02-12 13:15:23 -0500 (Mon, 12 Feb 2007)
New Revision: 762
Modified:
branches/3.2.x/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp
Log:
Skip Foreign Key with column type mismatch
Modified: branches/3.2.x/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp
===================================================================
--- branches/3.2.x/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp 2007-02-12 17:26:24 UTC (rev 761)
+++ branches/3.2.x/Utilities/SchemaMgr/Src/Sm/Ph/Rd/PropertyReader.cpp 2007-02-12 18:15:23 UTC (rev 762)
@@ -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