1 //---------------------------------------------------------------------
2 // <copyright file="SymbolPair.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
11 using System.Collections.Generic;
12 using System.Diagnostics;
15 using System.Data.SqlClient;
16 using System.Data.Metadata.Edm;
17 using System.Data.Common.CommandTrees;
19 namespace System.Data.SqlClient.SqlGen
22 /// The SymbolPair exists to solve the record flattening problem.
23 /// <see cref="SqlGenerator.Visit(DbPropertyExpression)"/>
24 /// Consider a property expression D(v, "j3.j2.j1.a.x")
25 /// where v is a VarRef, j1, j2, j3 are joins, a is an extent and x is a columns.
26 /// This has to be translated eventually into {j'}.{x'}
28 /// The source field represents the outermost SqlStatement representing a join
29 /// expression (say j2) - this is always a Join symbol.
31 /// The column field keeps moving from one join symbol to the next, until it
32 /// stops at a non-join symbol.
34 /// This is returned by <see cref="SqlGenerator.Visit(DbPropertyExpression)"/>,
35 /// but never makes it into a SqlBuilder.
37 class SymbolPair : ISqlFragment
42 public SymbolPair(Symbol source, Symbol column)
48 #region ISqlFragment Members
50 public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
52 // Symbol pair should never be part of a SqlBuilder.