[fdo-commits] r684 - trunk/Utilities/SchemaMgr/Src/Sm/Lp

svn_fdo at osgeo.org svn_fdo at osgeo.org
Mon Jan 29 15:00:50 EST 2007


Author: gavincramer
Date: 2007-01-29 15:00:50 -0500 (Mon, 29 Jan 2007)
New Revision: 684

Modified:
   trunk/Utilities/SchemaMgr/Src/Sm/Lp/ClassDefinition.cpp
Log:
Port FDO335 from 3.2.x to trunk

Modified: trunk/Utilities/SchemaMgr/Src/Sm/Lp/ClassDefinition.cpp
===================================================================
--- trunk/Utilities/SchemaMgr/Src/Sm/Lp/ClassDefinition.cpp	2007-01-29 19:47:28 UTC (rev 683)
+++ trunk/Utilities/SchemaMgr/Src/Sm/Lp/ClassDefinition.cpp	2007-01-29 20:00:50 UTC (rev 684)
@@ -2261,7 +2261,7 @@
                     // don't create a new one.
                     mPhDbObject = dbObject;
                 }
-                else if ( mbHasFdoIdentity ) {
+                else if ( mbHasFdoIdentity && FdoSmPhOwnerP(pPhysical->GetOwner())->GetHasMetaSchema() ) {
 
                     // No table is created if there are no id properties. Classes without id
 	                // are only used as object property types.
@@ -2456,21 +2456,21 @@
 
     if ( !pPathDbObject ) {
 	    // No direct join , so check each dependency to see if it leads to a join path
-	    for ( int i = 0; i < pDeps->GetCount(); i++ ) {
-		    const FdoSmPhDependency* pDep = pDeps->RefItem(i);
+	for ( int i = 0; i < pDeps->GetCount(); i++ ) {
+		const FdoSmPhDependency* pDep = pDeps->RefItem(i);
 
-		    // Consider only cardinality 1 dependencies because collections of data
-		    // properties are not supported.
-		    if ( pDep->GetCardinality() == 1 ) {
-			    FdoSmLpDbObjectP pCurrDbObject;
+		// Consider only cardinality 1 dependencies because collections of data
+		// properties are not supported.
+		if ( pDep->GetCardinality() == 1 ) {
+			FdoSmLpDbObjectP pCurrDbObject;
 
-			    // Get the primary key table and Finalize it.
-                FdoSmPhMgrP      pPhysical = GetLogicalPhysicalSchema()->GetPhysicalSchema();
-                FdoSmPhDbObjectP pDepDbObject;
-                if (FdoSmPhOwnerP(pPhysical->GetOwner())->GetHasMetaSchema())
-			        pDepDbObject = pPhysical->FindDbObject( pDep->GetPkTableName() );
-                else
-			        pDepDbObject = pPhysical->FindDbObject( pDep->GetPkTableName(), mOwner );
+			// Get the primary key table and Finalize it.
+            FdoSmPhMgrP      pPhysical = GetLogicalPhysicalSchema()->GetPhysicalSchema();
+            FdoSmPhDbObjectP pDepDbObject;
+            if (FdoSmPhOwnerP(pPhysical->GetOwner())->GetHasMetaSchema())
+			    pDepDbObject = pPhysical->FindDbObject( pDep->GetPkTableName() );
+            else
+			    pDepDbObject = pPhysical->FindDbObject( pDep->GetPkTableName(), mOwner );
 
                 // Optimization: No need to follow the primary key table if it has no 
                 // "Up" dependencies. This saves a lot of time when following dependencies
@@ -2478,19 +2478,19 @@
                 // to tables that do not have "up" dependencies. Skipping FinalizeDbObject for 
                 // these tables saves a lot of time for datastores with many classes.
 			    if ( pDepDbObject && (pDepDbObject->GetDependenciesUp()->GetCount() > 0) ) 
-				    pCurrDbObject = FinalizeDbObject( pDepDbObject, dbObjects, iLevel + 1, pProp );
-    			
-			    // If it was successfully finalized, check if it has a join path to the class table and 
-			    // it's the shortest path encountered so far.
-			    if ( pCurrDbObject && (pCurrDbObject->GetPathDist() >= 0) && (pCurrDbObject->GetPathDist() < iMinDist) ) {
-				    // If so then it is the current candidate for the next table in the 
-				    // join path.
-				    iMinDist = pCurrDbObject->GetPathDist();
-				    pPathDbObject = (pCurrDbObject->GetPathDist() == 0) ? mDbObject : pCurrDbObject;
-				    pPathDep = pDep;
-			    }
-		    }
-	    }
+				pCurrDbObject = FinalizeDbObject( pDepDbObject, dbObjects, iLevel + 1, pProp );
+			
+			// If it was successfully finalized, check if it has a join path to the class table and 
+			// it's the shortest path encountered so far.
+			if ( pCurrDbObject && (pCurrDbObject->GetPathDist() >= 0) && (pCurrDbObject->GetPathDist() < iMinDist) ) {
+				// If so then it is the current candidate for the next table in the 
+				// join path.
+				iMinDist = pCurrDbObject->GetPathDist();
+				pPathDbObject = (pCurrDbObject->GetPathDist() == 0) ? mDbObject : pCurrDbObject;
+				pPathDep = pDep;
+			}
+		}
+	}
     }
 
 	if ( pPathDbObject ) {



More information about the fdo-commits mailing list