Beispiel #1
0
        private void WriteJoinPredicates(DbTextWriter writer, IEnumerable <JoinPredicate> predicates)
        {
            foreach (JoinPredicate predicate in predicates)
            {
                writer.Write(" LEFT JOIN {0} ON ", "[" + predicate.ToColumn.Table.Owner + "].[" + predicate.ToColumn.Table.Name + "] " + writer.GetTableAlias(predicate.ToColumn.Table));

                if (predicate.IsGroup)
                {
                    WriteBeginGroup(writer);
                    for (JoinPredicate current = predicate; current != null; current = current.NextInGroup)
                    {
                        WriteJoinPredicate(writer, current);
                    }
                }
                else
                {
                    WriteJoinPredicate(writer, predicate);
                }
            }
        }
Beispiel #2
0
 protected virtual void OnWriteAnd(DbTextWriter writer)
 {
     writer.Write(" AND ");
 }
Beispiel #3
0
 protected virtual void OnWriteEndGroup(DbTextWriter writer)
 {
     writer.Write(")");
     groupCount--;
 }
Beispiel #4
0
 protected virtual void OnWriteOr(DbTextWriter writer)
 {
     writer.Write(" OR ");
 }
Beispiel #5
0
 protected virtual void OnWriteBeginGroup(DbTextWriter writer)
 {
     writer.Write("(");
 }