Exemplo n.º 1
0
 public FilterItem setQuery(Query query)
 {
     _query = query;
     if (_childItems == null)
     {
         if (_expression == null)
         {
             if (_selectItem.getQuery() == null)
             {
                 _selectItem.setQuery(_query);
             }
             if (_operand is SelectItem)
             {
                 SelectItem operand = (SelectItem)_operand;
                 if (operand.getQuery() == null)
                 {
                     operand.setQuery(_query);
                 }
             }
         }
     }
     else
     {
         foreach (FilterItem item in _childItems)
         {
             if (item.getQuery() == null)
             {
                 item.setQuery(_query);
             }
         }
     }
     return(this);
 }
        } // select()

        public Query select(params Column[] columns)
        {
            foreach (Column column in columns)
            {
                SelectItem selectItem = new SelectItem(column);
                selectItem.setQuery(this);
                _selectClause.addItem(selectItem);
            }
            return(this);
        } // select()
        } // groupBy()

        public Query groupBy(params GroupByItem[] items)
        {
            foreach (GroupByItem item in items)
            {
                SelectItem selectItem = item.getSelectItem();
                if (selectItem != null && selectItem.getQuery() == null)
                {
                    selectItem.setQuery(this);
                }
            }
            _groupByClause.addItems(items);
            return(this);
        } // groupBy()