1070 |
substr($filterString, $pos, $len) = $sqlReference; |
substr($filterString, $pos, $len) = $sqlReference; |
1071 |
# Reposition the search. |
# Reposition the search. |
1072 |
pos $filterString = $pos + length $sqlReference; |
pos $filterString = $pos + length $sqlReference; |
|
Trace("New filter string is \"$filterString\".") if T(4); |
|
1073 |
} |
} |
1074 |
} |
} |
1075 |
} |
} |
1115 |
} |
} |
1116 |
# Add the filter and the join clauses (if any) to the SELECT command. |
# Add the filter and the join clauses (if any) to the SELECT command. |
1117 |
if ($filterString) { |
if ($filterString) { |
1118 |
|
Trace("Filter string is \"$filterString\".") if T(4); |
1119 |
push @joinWhere, "($filterString)"; |
push @joinWhere, "($filterString)"; |
1120 |
} |
} |
1121 |
if (@joinWhere) { |
if (@joinWhere) { |
1126 |
$command .= " $orderClause"; |
$command .= " $orderClause"; |
1127 |
} |
} |
1128 |
} |
} |
1129 |
Trace("SQL query: $command") if T(SQL => 4); |
Trace("SQL query: $command") if T(SQL => 3); |
1130 |
Trace("PARMS: '" . (join "', '", @params) . "'") if (T(SQL => 4) && (@params > 0)); |
Trace("PARMS: '" . (join "', '", @params) . "'") if (T(SQL => 4) && (@params > 0)); |
1131 |
my $sth = $dbh->prepare_command($command); |
my $sth = $dbh->prepare_command($command); |
1132 |
# Execute it with the parameters bound in. |
# Execute it with the parameters bound in. |
2596 |
# Determine if this relationship has our entity in one of its link fields. |
# Determine if this relationship has our entity in one of its link fields. |
2597 |
my $fromEntity = $relationship->{from}; |
my $fromEntity = $relationship->{from}; |
2598 |
my $toEntity = $relationship->{to}; |
my $toEntity = $relationship->{to}; |
2599 |
Trace("Join check for relationship $relationshipName from $fromEntity to $toEntity.") if T(4); |
Trace("Join check for relationship $relationshipName from $fromEntity to $toEntity.") if T(Joins => 4); |
2600 |
if ($fromEntity eq $entityName) { |
if ($fromEntity eq $entityName) { |
2601 |
if ($toEntity eq $entityName) { |
if ($toEntity eq $entityName) { |
2602 |
# Here the relationship is recursive. |
# Here the relationship is recursive. |