Exemplo n.º 1
0
        internal override StringBuilder AsEsql(StringBuilder builder, bool isTopLevel, int indentLevel)
        {
            // The SELECT/DISTINCT part.
            StringUtil.IndentNewLine(builder, indentLevel);
            builder.Append("SELECT ");
            if (m_selectDistinct == CellQuery.SelectDistinct.Yes)
            {
                builder.Append("DISTINCT ");
            }
            GenerateProjectionEsql(builder, m_nodeTableAlias, true, indentLevel, isTopLevel);

            // Get the FROM part.
            builder.Append("FROM ");
            CqlWriter.AppendEscapedQualifiedName(builder, m_extent.EntityContainer.Name, m_extent.Name);
            builder.Append(" AS ").Append(m_nodeTableAlias);

            // Get the WHERE part only when the expression is not simply TRUE.
            if (!BoolExpression.EqualityComparer.Equals(WhereClause, BoolExpression.True))
            {
                StringUtil.IndentNewLine(builder, indentLevel);
                builder.Append("WHERE ");
                WhereClause.AsEsql(builder, m_nodeTableAlias);
            }

            return(builder);
        }
 internal static void AppendEscapedQualifiedName(
     StringBuilder builder,
     string name1,
     string name2)
 {
     CqlWriter.AppendEscapedName(builder, name1);
     builder.Append('.');
     CqlWriter.AppendEscapedName(builder, name2);
 }
 internal override StringBuilder AsEsql(
     StringBuilder builder,
     bool isTopLevel,
     int indentLevel)
 {
     StringUtil.IndentNewLine(builder, indentLevel);
     builder.Append("SELECT ");
     if (this.m_selectDistinct == CellQuery.SelectDistinct.Yes)
     {
         builder.Append("DISTINCT ");
     }
     this.GenerateProjectionEsql(builder, this.m_nodeTableAlias, true, indentLevel, isTopLevel);
     builder.Append("FROM ");
     CqlWriter.AppendEscapedQualifiedName(builder, this.m_extent.EntityContainer.Name, this.m_extent.Name);
     builder.Append(" AS ").Append(this.m_nodeTableAlias);
     if (!BoolExpression.EqualityComparer.Equals(this.WhereClause, BoolExpression.True))
     {
         StringUtil.IndentNewLine(builder, indentLevel);
         builder.Append("WHERE ");
         this.WhereClause.AsEsql(builder, this.m_nodeTableAlias);
     }
     return(builder);
 }
Exemplo n.º 4
0
 internal string GetQualifiedCqlName(MemberPath outputMember)
 {
     return(CqlWriter.GetQualifiedName(m_block.CqlAlias, GetCqlFieldAlias(outputMember)));
 }
 internal static void AppendEscapedTypeName(StringBuilder builder, EdmType type)
 {
     CqlWriter.AppendEscapedName(builder, CqlWriter.GetQualifiedName(type.NamespaceName, type.Name));
 }