[Bio] / Sprout / ERDB.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.33, Sat Jan 28 09:36:47 2006 UTC revision 1.35, Sat Jan 28 09:57:43 2006 UTC
# Line 1146  Line 1146 
1146                          # the current entity, so we need to stack it.                          # the current entity, so we need to stack it.
1147                          my @stackList = (@augmentedList, $toEntity);                          my @stackList = (@augmentedList, $toEntity);
1148                          push @fromPathList, \@stackList;                          push @fromPathList, \@stackList;
1149                        } else {
1150                            Trace("$toEntity ignored because it occurred previously.") if T(4);
1151                      }                      }
1152                  }                  }
1153              }              }
# Line 1171  Line 1173 
1173      for my $keyName ('to_link', 'from_link') {      for my $keyName ('to_link', 'from_link') {
1174          # Get the list for this key.          # Get the list for this key.
1175          my @pathList = @{$stackList{$keyName}};          my @pathList = @{$stackList{$keyName}};
1176            Trace(scalar(@pathList) . " entries in path list for $keyName.") if T(3);
1177          # Loop through this list.          # Loop through this list.
1178          while (my $path = pop @pathList) {          while (my $path = pop @pathList) {
1179              # Get the table whose rows are to be deleted.              # Get the table whose rows are to be deleted.
# Line 1191  Line 1194 
1194                  # Connect the current relationship to the preceding entity.                  # Connect the current relationship to the preceding entity.
1195                  my ($entity, $rel) = @pathTables[$i-1,$i];                  my ($entity, $rel) = @pathTables[$i-1,$i];
1196                  # The style of connection depends on the direction of the relationship.                  # The style of connection depends on the direction of the relationship.
1197                  $stmt .= " AND $entity.id = $rel.from_link";                  $stmt .= " AND $entity.id = $rel.$keyName";
1198                  if ($i + 1 <= $#pathTables) {                  if ($i + 1 <= $#pathTables) {
1199                      # Here there's a next entity, so connect that to the relationship's                      # Here there's a next entity, so connect that to the relationship's
1200                      # to-link.                      # to-link.
1201                      my $entity2 = $pathTables[$i+1];                      my $entity2 = $pathTables[$i+1];
1202                      $stmt .= " AND $rel.$keyName = $entity2.id";                      $stmt .= " AND $rel.to_link = $entity2.id";
1203                  }                  }
1204              }              }
1205              # Now we have our desired DELETE statement.              # Now we have our desired DELETE statement.

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.35

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3