public void AddRange(WhereClause[] val)
 {
     for (int i = 0; i < val.Length; i++)
     {
         this.Add(val[i]);
     }
 }
Esempio n. 2
0
 private string RenderSelect(SelectQuery query, int limitRows)
 {
     query.Validate();
     StringBuilder builder = new StringBuilder();
     this.Select(builder, query.Distinct);
     this.SelectColumns(builder, query.Columns);
     this.FromClause(builder, query.FromClause, query.TableSpace);
     WhereClause group = new WhereClause(WhereClauseRelationship.And);
     group.SubClauses.Add(query.WherePhrase);
     if (limitRows > -1)
     {
         group.Terms.Add(WhereTerm.CreateCompare(SqlExpression.PseudoField("rownum"), SqlExpression.Number(limitRows), CompareOperator.LessOrEqual));
     }
     this.Where(builder, group);
     this.WhereClause(builder, group);
     this.GroupBy(builder, query.GroupByTerms);
     if (query.GroupByWithCube)
     {
         builder.Append(" cube (");
     }
     else if (query.GroupByWithRollup)
     {
         builder.Append(" rollup (");
     }
     this.GroupByTerms(builder, query.GroupByTerms);
     if (query.GroupByWithCube || query.GroupByWithRollup)
     {
         builder.Append(" )");
     }
     this.Having(builder, query.HavingPhrase);
     this.WhereClause(builder, query.HavingPhrase);
     this.OrderBy(builder, query.OrderByTerms);
     this.OrderByTerms(builder, query.OrderByTerms);
     return builder.ToString();
 }
Esempio n. 3
0
 public WhereClause Clone()
 {
     WhereClause clause = new WhereClause();
     clause.relationship = this.relationship;
     clause.whereTerms = new WhereTermCollection(this.whereTerms);
     foreach (WhereClause clause2 in this.clauses)
     {
         clause.clauses.Add(clause2.Clone());
     }
     return clause;
 }
 public void Remove(WhereClause val)
 {
     base.List.Remove(val);
 }
 public void Insert(int index, WhereClause val)
 {
     base.List.Insert(index, val);
 }
 public int IndexOf(WhereClause val)
 {
     return base.List.IndexOf(val);
 }
 public void CopyTo(WhereClause[] array, int index)
 {
     base.List.CopyTo(array, index);
 }
 public bool Contains(WhereClause val)
 {
     return base.List.Contains(val);
 }
 public int Add(WhereClause val)
 {
     return base.List.Add(val);
 }
 public WhereClauseCollection(WhereClause[] val)
 {
     this.AddRange(val);
 }
Esempio n. 11
0
 public CaseTerm(WhereClause condition, SqlExpression val)
 {
     this.cond = condition;
     this.val = val;
 }