internal void GetEquiJoinPredicates( VarVec leftTableDefinitions, VarVec rightTableDefinitions, out List <Var> leftTableEquiJoinColumns, out List <Var> rightTableEquiJoinColumns, out Predicate otherPredicates) { otherPredicates = new Predicate(this.m_command); leftTableEquiJoinColumns = new List <Var>(); rightTableEquiJoinColumns = new List <Var>(); foreach (System.Data.Entity.Core.Query.InternalTrees.Node part in this.m_parts) { Var leftVar; Var rightVar; if (Predicate.IsEquiJoinPredicate(part, leftTableDefinitions, rightTableDefinitions, out leftVar, out rightVar)) { leftTableEquiJoinColumns.Add(leftVar); rightTableEquiJoinColumns.Add(rightVar); } else { otherPredicates.AddPart(part); } } }
private static bool IsEquiJoinPredicate( System.Data.Entity.Core.Query.InternalTrees.Node simplePredicateNode, VarVec leftTableDefinitions, VarVec rightTableDefinitions, out Var leftVar, out Var rightVar) { leftVar = (Var)null; rightVar = (Var)null; Var leftVar1; Var rightVar1; if (!Predicate.IsEquiJoinPredicate(simplePredicateNode, out leftVar1, out rightVar1)) { return(false); } if (leftTableDefinitions.IsSet(leftVar1) && rightTableDefinitions.IsSet(rightVar1)) { leftVar = leftVar1; rightVar = rightVar1; } else { if (!leftTableDefinitions.IsSet(rightVar1) || !rightTableDefinitions.IsSet(leftVar1)) { return(false); } leftVar = rightVar1; rightVar = leftVar1; } return(true); }
internal Predicate GetJoinPredicates( VarVec leftTableDefinitions, VarVec rightTableDefinitions, out Predicate otherPredicates) { Predicate predicate = new Predicate(this.m_command); otherPredicates = new Predicate(this.m_command); foreach (System.Data.Entity.Core.Query.InternalTrees.Node part in this.m_parts) { Var leftVar; Var rightVar; if (Predicate.IsEquiJoinPredicate(part, leftTableDefinitions, rightTableDefinitions, out leftVar, out rightVar)) { predicate.AddPart(part); } else { otherPredicates.AddPart(part); } } return(predicate); }