Exemplo n.º 1
0
        protected override void DoProcess(SQLProcessorAggregator aggregator, MultiPredicate obj, StringBuilder builder, Boolean negationActive)
        {
            aggregator.Process(obj.Left, builder);
            builder.Append(SQLConstants.TOKEN_SEPARATOR).Append(negationActive ? this._negatedOperator : this._operator).Append(SQLConstants.TOKEN_SEPARATOR);
            if (this._needParenthesis)
            {
                builder.Append(SQLConstants.OPEN_PARENTHESIS);
            }

            ProcessorUtils.AppendEnumerable(aggregator, builder, obj.Rights, this._separator, (agg, b, exp) =>
            {
                var isQuery = exp is QueryExpression;
                if (isQuery)
                {
                    b.Append(SQLConstants.OPEN_PARENTHESIS);
                }
                agg.Process(exp, b);
                if (isQuery)
                {
                    b.Append(SQLConstants.CLOSE_PARENTHESIS);
                }
            });

            if (this._needParenthesis)
            {
                builder.Append(SQLConstants.CLOSE_PARENTHESIS);
            }
        }
Exemplo n.º 2
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, OrderByClause obj, StringBuilder builder)
 {
     if (obj.OrderingColumns.Length > 0)
     {
         builder.Append(SQLConstants.NEWLINE + SQLConstants.ORDER_BY + SQLConstants.TOKEN_SEPARATOR);
         ProcessorUtils.AppendEnumerable(aggregator, builder, obj.OrderingColumns, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
     }
 }
Exemplo n.º 3
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, GroupByClause obj, StringBuilder builder)
 {
     if (obj.GroupingElements.Length > 0)
     {
         builder.Append(SQLConstants.NEWLINE + SQLConstants.GROUP_BY + SQLConstants.TOKEN_SEPARATOR);
         ProcessorUtils.AppendEnumerable(aggregator, builder, obj.GroupingElements, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
     }
 }
Exemplo n.º 4
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, FromClause obj, StringBuilder builder)
 {
     if (obj.TableReferences.Length > 0)
     {
         builder.Append(SQLConstants.NEWLINE + SQLConstants.FROM + SQLConstants.TOKEN_SEPARATOR);
         ProcessorUtils.AppendEnumerable(aggregator, builder, obj.TableReferences, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
     }
 }
Exemplo n.º 5
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, UpdateBySearch obj, StringBuilder builder)
 {
     builder.Append("UPDATE ");
     aggregator.Process(obj.TargetTable, builder);
     builder.Append(SQLConstants.NEWLINE).Append("SET ");
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.SetClauses, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
     ProcessorUtils.ProcessOptionalBooleanExpresssion(aggregator, builder, obj.Condition, SQLConstants.NEWLINE, SQLConstants.WHERE);
 }
Exemplo n.º 6
0
 public static void DoProcessSelectColumnsStatic(SQLProcessorAggregator aggregator, ColumnReferences obj, StringBuilder builder)
 {
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.Columns, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR, (agg, b, col) =>
     {
         agg.Process(col.Reference, b);
         if (!String.IsNullOrEmpty(col.Alias))
         {
             b.Append(SQLConstants.TOKEN_SEPARATOR + SQLConstants.ALIAS_DEFINER + SQLConstants.TOKEN_SEPARATOR).Append(col.Alias);
         }
     });
 }
Exemplo n.º 7
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, QuerySpecification obj, StringBuilder builder)
 {
     aggregator.Process(obj.Select, builder);
     aggregator.Process(obj.From, builder);
     ProcessorUtils.ProcessOptionalBooleanExpresssion(aggregator, builder, obj.Where, SQLConstants.NEWLINE, SQLConstants.WHERE);
     aggregator.Process(obj.GroupBy, builder);
     ProcessorUtils.ProcessOptionalBooleanExpresssion(aggregator, builder, obj.Having, SQLConstants.NEWLINE, SQLConstants.HAVING);
     aggregator.Process(obj.OrderBy, builder);
     if (obj.Offset != null || obj.Limit != null)
     {
         this.ProcessOffsetAndLimit(aggregator, obj.Offset, obj.Limit, builder);
     }
 }
Exemplo n.º 8
0
 public static void ProcessValues(SQLProcessorAggregator aggregator, AbstractValuesList values, StringBuilder builder)
 {
     builder.Append("VALUES");
     ProcessorUtils.AppendEnumerable(aggregator, builder, values.Values, SQLConstants.COMMA, (agg, b, exp) =>
     {
         builder.Append(SQLConstants.OPEN_PARENTHESIS);
         ProcessorUtils.AppendEnumerable(aggregator, builder, exp, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR, (agg2, b2, exp2) =>
         {
             var needParenthesis = exp2 is QueryExpression;
             if (needParenthesis)
             {
                 b2.Append(SQLConstants.OPEN_PARENTHESIS);
             }
             agg2.Process(exp2, b2);
             if (needParenthesis)
             {
                 b2.Append(SQLConstants.CLOSE_PARENTHESIS);
             }
         });
         builder.Append(SQLConstants.CLOSE_PARENTHESIS);
     });
 }
Exemplo n.º 9
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, ColumnNameList obj, StringBuilder builder)
 {
     builder.Append(SQLConstants.OPEN_PARENTHESIS);
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.ColumnNames, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR, (agg, b, str) => b.Append(str));
     builder.Append(SQLConstants.CLOSE_PARENTHESIS);
 }
Exemplo n.º 10
0
 protected override void DoProcessActually(SQLProcessorAggregator aggregator, RowDefinition obj, StringBuilder builder)
 {
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.RowElements, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
 }
Exemplo n.º 11
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, TableValueConstructor obj, StringBuilder builder)
 {
     builder.Append("VALUES" + SQLConstants.TOKEN_SEPARATOR);
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.Rows, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
 }
Exemplo n.º 12
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, OrdinaryGroupingSet obj, StringBuilder builder)
 {
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.Columns, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
 }
Exemplo n.º 13
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, SQLFunctionLiteral obj, StringBuilder builder)
 {
     builder.Append(obj.FunctionName).Append(SQLConstants.OPEN_PARENTHESIS);
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.Parameters, SQLConstants.COMMA + SQLConstants.TOKEN_SEPARATOR);
     builder.Append(SQLConstants.CLOSE_PARENTHESIS);
 }
Exemplo n.º 14
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, DeleteBySearch obj, StringBuilder builder)
 {
     builder.Append("DELETE FROM ");
     aggregator.Process(obj.TargetTable, builder);
     ProcessorUtils.ProcessOptionalBooleanExpresssion(aggregator, builder, obj.Condition, SQLConstants.NEWLINE, SQLConstants.WHERE);
 }
Exemplo n.º 15
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, TableElementList obj, StringBuilder builder)
 {
     builder.Append(SQLConstants.OPEN_PARENTHESIS).Append(SQLConstants.NEWLINE);
     ProcessorUtils.AppendEnumerable(aggregator, builder, obj.Elements, SQLConstants.COMMA + SQLConstants.NEWLINE);
     builder.Append(SQLConstants.NEWLINE).Append(SQLConstants.CLOSE_PARENTHESIS);
 }
Exemplo n.º 16
0
 protected override void DoProcess(SQLProcessorAggregator aggregator, Disjunction obj, StringBuilder builder, Boolean negationActive)
 {
     ProcessorUtils.ProcessBinaryComposedBooleanExpression(aggregator, builder, negationActive, SQLConstants.OR, obj.Left, obj.Right);
 }