Select.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file Select.cpp
22 
23  \brief A Select models a query to be used when retrieving data from a data source.
24 */
25 
26 // TerraLib
27 #include "../../common/STLUtils.h"
28 #include "DataSetName.h"
29 #include "Distinct.h"
30 #include "Expression.h"
31 #include "Field.h"
32 #include "FromItem.h"
33 #include "GroupByItem.h"
34 #include "Having.h"
35 #include "OrderByItem.h"
36 #include "PropertyName.h"
37 #include "Select.h"
38 #include "Where.h"
39 
40 te::da::Select::Select() : m_limit(), m_offset()
41 {
42 }
43 
45  : m_fields(fds),
46  m_from(f),
47  m_where(w),
48 
49  m_orderBy(o),
50 
51  m_limit(),
52  m_offset()
53 {
54 }
55 
57 {
58  m_fields.reset(new Fields(fds));
59 }
60 
61 te::da::Select::Select(const Fields& fds, const From& f) : m_limit(), m_offset()
62 {
63  m_fields.reset(new Fields(fds));
64  m_from.reset(new From(f));
65 }
66 
67 te::da::Select::Select(const Fields& fds, const From& f, const Where& w)
68  : m_limit(), m_offset()
69 {
70  m_fields.reset(new Fields(fds));
71  m_from.reset(new From(f));
72  m_where.reset(new Where(w));
73 }
74 
75 te::da::Select::Select(const Fields& fds, const From& f, const Where& w,
76  const OrderBy& o)
77  : m_limit(), m_offset()
78 {
79  m_fields.reset(new Fields(fds));
80  m_from.reset(new From(f));
81  m_where.reset(new Where(w));
82  m_orderBy.reset(new OrderBy(o));
83 }
84 
86  : m_fields(fds),
87  m_from(f),
88 
89  m_orderBy(o),
90 
91  m_limit(),
92  m_offset()
93 {
94 }
95 
96 te::da::Select::Select(const Fields& fds, const From& f, const OrderBy& o)
97  : m_limit(), m_offset()
98 {
99  m_fields.reset(new Fields(fds));
100  m_from.reset(new From(f));
101  m_orderBy.reset(new OrderBy(o));
102 }
103 
105  : m_fields(fds),
106  m_from(f),
107  m_where(w),
108  m_groupBy(gb),
109 
110  m_orderBy(o),
111 
112  m_limit(),
113  m_offset()
114 {
115 }
116 
117 te::da::Select::Select(const Fields& fds, const From& f, const Where& w,
118  const GroupBy& gb)
119  : m_limit(), m_offset()
120 {
121  m_fields.reset(new Fields(fds));
122  m_from.reset(new From(f));
123  m_where.reset(new Where(w));
124  m_groupBy.reset(new GroupBy(gb));
125 }
126 
127 te::da::Select::Select(const Fields& fds, const From& f, const Where& w,
128  const GroupBy& gb, const OrderBy& o)
129  : m_limit(), m_offset()
130 {
131  m_fields.reset(new Fields(fds));
132  m_from.reset(new From(f));
133  m_where.reset(new Where(w));
134  m_groupBy.reset(new GroupBy(gb));
135  m_orderBy.reset(new OrderBy(o));
136 }
137 
139  : m_fields(fds),
140  m_from(f),
141 
142  m_groupBy(gb),
143 
144  m_orderBy(o),
145 
146  m_limit(),
147  m_offset()
148 {
149 }
150 
151 te::da::Select::Select(const Fields& fds, const From& f, const GroupBy& gb)
152  : m_limit(), m_offset()
153 {
154  m_fields.reset(new Fields(fds));
155  m_from.reset(new From(f));
156  m_groupBy.reset(new GroupBy(gb));
157 }
158 
159 te::da::Select::Select(const Fields& fds, const From& f, const GroupBy& gb,
160  const OrderBy& o)
161  : m_limit(), m_offset()
162 {
163  m_fields.reset(new Fields(fds));
164  m_from.reset(new From(f));
165  m_groupBy.reset(new GroupBy(gb));
166  m_orderBy.reset(new OrderBy(o));
167 }
168 
170  OrderBy* o)
171  : m_fields(fds),
172  m_from(f),
173  m_where(w),
174  m_groupBy(gb),
175  m_having(h),
176  m_orderBy(o),
177 
178  m_limit(),
179  m_offset()
180 {
181 }
182 
183 te::da::Select::Select(const Fields& fds, const From& f, const Where& w,
184  const GroupBy& gb, const Having& h)
185  : m_limit(), m_offset()
186 {
187  m_fields.reset(new Fields(fds));
188  m_from.reset(new From(f));
189  m_where.reset(new Where(w));
190  m_groupBy.reset(new GroupBy(gb));
191  m_having.reset(new Having(h));
192 }
193 
194 te::da::Select::Select(const Fields& fds, const From& f, const Where& w,
195  const GroupBy& gb, const Having& h, const OrderBy& o)
196  : m_limit(), m_offset()
197 {
198  m_fields.reset(new Fields(fds));
199  m_from.reset(new From(f));
200  m_where.reset(new Where(w));
201  m_groupBy.reset(new GroupBy(gb));
202  m_having.reset(new Having(h));
203  m_orderBy.reset(new OrderBy(o));
204 }
205 
207 {
208  m_fields.reset(new Fields);
209  m_fields->push_back(f);
210 }
211 
213 {
214  m_fields.reset(new Fields);
215  m_fields->push_back(new Field(f));
216 }
217 
218 te::da::Select::Select(const std::string& propertyName) : m_limit(), m_offset()
219 {
220  m_fields.reset(new Fields);
221  m_fields->push_back(new Field(propertyName));
222 }
223 
224 te::da::Select::Select(const std::string& propertyName,
225  const std::string& alias)
226  : m_limit(), m_offset()
227 {
228  m_fields.reset(new Fields);
229  m_fields->push_back(new Field(propertyName, alias));
230 }
231 
233  : m_limit(rhs.m_limit), m_offset(rhs.m_offset)
234 {
235  m_fields.reset(rhs.m_fields.get() ? new Fields(*rhs.m_fields) : nullptr);
236  m_from.reset(rhs.m_from.get() ? new From(*rhs.m_from) : nullptr);
237  m_where.reset(rhs.m_where.get() ? new Where(*rhs.m_where) : nullptr);
238  m_groupBy.reset(rhs.m_groupBy.get() ? new GroupBy(*rhs.m_groupBy) : nullptr);
239  m_having.reset(rhs.m_having.get() ? new Having(*rhs.m_having) : nullptr);
240  m_orderBy.reset(rhs.m_orderBy.get() ? new OrderBy(*rhs.m_orderBy) : nullptr);
241  m_distinct.reset(rhs.m_distinct.get() ? new Distinct(*rhs.m_distinct) : nullptr);
242 }
243 
245  : m_limit(rhs->m_limit), m_offset(rhs->m_offset)
246 {
247  m_fields.reset(rhs->m_fields.get() ? new Fields(*rhs->m_fields) : nullptr);
248  m_from.reset(rhs->m_from.get() ? new From(*rhs->m_from) : nullptr);
249  m_where.reset(rhs->m_where.get() ? new Where(*rhs->m_where) : nullptr);
250  m_groupBy.reset(rhs->m_groupBy.get() ? new GroupBy(*rhs->m_groupBy) : nullptr);
251  m_having.reset(rhs->m_having.get() ? new Having(*rhs->m_having) : nullptr);
252  m_orderBy.reset(rhs->m_orderBy.get() ? new OrderBy(*rhs->m_orderBy) : nullptr);
253  m_distinct.reset(rhs->m_distinct.get() ? new Distinct(*rhs->m_distinct) : nullptr);
254 }
255 
256 te::da::Select::~Select() = default;
257 
259 {
260  if(this != &rhs)
261  {
262  m_fields.reset(rhs.m_fields.get() ? new Fields(*rhs.m_fields) : nullptr);
263  m_from.reset(rhs.m_from.get() ? new From(*rhs.m_from) : nullptr);
264  m_where.reset(rhs.m_where.get() ? new Where(*rhs.m_where) : nullptr);
265  m_groupBy.reset(rhs.m_groupBy.get() ? new GroupBy(*rhs.m_groupBy) : nullptr);
266  m_having.reset(rhs.m_having.get() ? new Having(*rhs.m_having) : nullptr);
267  m_orderBy.reset(rhs.m_orderBy.get() ? new OrderBy(*rhs.m_orderBy) : nullptr);
268  m_distinct.reset(rhs.m_distinct.get() ? new Distinct(*rhs.m_distinct) : nullptr);
269  m_limit = rhs.m_limit;
270  m_offset = rhs.m_offset;
271  }
272 
273  return *this;
274 }
275 
277 {
278  return new Select(*this);
279 }
280 
282 {
283  m_fields.reset(new Fields(f));
284  return *this;
285 }
286 
288 {
289  m_fields.reset(f);
290  return *this;
291 }
292 
294 {
295  return *m_fields;
296 }
297 
299 {
300  return *m_fields;
301 }
302 
304 {
305  assert(m_fields.get() != nullptr);
306 
307  m_fields->push_back(new Field(f));
308 
309  return *this;
310 }
311 
313 {
314  assert(m_fields.get() != nullptr);
315 
316  m_fields->push_back(f);
317 
318  return *this;
319 }
320 
321 te::da::Select& te::da::Select::operator()(const std::string& propertyName)
322 {
323  assert(m_fields.get() != nullptr);
324 
325  m_fields->push_back(new Field(propertyName));
326 
327  return *this;
328 }
329 
330 te::da::Select& te::da::Select::operator()(const std::string& propertyName, const std::string& alias)
331 {
332  assert(m_fields.get() != nullptr);
333 
334  m_fields->push_back(new Field(propertyName, alias));
335 
336  return *this;
337 }
338 
340 {
341  if(m_from.get() == nullptr)
342  m_from.reset(new From);
343 
344  m_from->push_back(item.clone());
345 
346  return *this;
347 }
348 
350 {
351  if(m_from.get() == nullptr)
352  m_from.reset(new From);
353 
354  m_from->push_back(item);
355 
356  return *this;
357 }
358 
360 {
361  if(m_from.get() == nullptr)
362  m_from.reset(new From);
363 
364  m_from->push_back(i1.clone());
365  m_from->push_back(i2.clone());
366 
367  return *this;
368 }
369 
371 {
372  if(m_from.get() == nullptr)
373  m_from.reset(new From);
374 
375  m_from->push_back(i1);
376  m_from->push_back(i2);
377 
378  return *this;
379 }
380 
382 {
383  if(m_from.get() == nullptr)
384  m_from.reset(new From);
385 
386  m_from->push_back(i1.clone());
387  m_from->push_back(i2.clone());
388  m_from->push_back(i3.clone());
389 
390  return *this;
391 }
392 
394 {
395  if(m_from.get() == nullptr)
396  m_from.reset(new From);
397 
398  m_from->push_back(i1);
399  m_from->push_back(i2);
400  m_from->push_back(i3);
401 
402  return *this;
403 }
404 
405 te::da::Select& te::da::Select::from(const std::string& datasetName)
406 {
407  if(m_from.get() == nullptr)
408  m_from.reset(new From);
409 
410  m_from->push_back(new DataSetName(datasetName));
411 
412  return *this;
413 }
414 
416 {
417  m_from.reset(f);
418  return *this;
419 }
420 
422 {
423  m_from.reset(new From(rhs));
424  return *this;
425 }
426 
428 {
429  return *m_from;
430 }
431 
433 {
434  return *m_from;
435 }
436 
438 {
439  return *this;
440 }
441 
443 {
444  return *this;
445 }
446 
448 {
449  return *this;
450 }
451 
453 {
454  return *this;
455 }
456 
458 {
459  return *this;
460 }
461 
463 {
464  return *this;
465 }
466 
468 {
469  return *this;
470 }
471 
473 {
474  return *this;
475 }
476 
478 {
479  return *this;
480 }
481 
483 {
484  return *this;
485 }
486 
488 {
489  return *this;
490 }
491 
493 {
494  return *this;
495 }
496 
498 {
499  return *this;
500 }
501 
503 {
504  return *this;
505 }
506 
508 {
509  if(m_where.get() == nullptr)
510  m_where.reset(new Where(e));
511  else
512  m_where->setExp(e);
513 
514  return *this;
515 }
516 
518 {
519  if(m_where.get() == nullptr)
520  m_where.reset(new Where(e));
521  else
522  m_where->setExp(e.clone());
523 
524  return *this;
525 }
526 
528 {
529  m_where.reset(w);
530  return *this;
531 }
532 
534 {
535  m_where.reset(new Where(rhs));
536  return *this;
537 }
538 
540 {
541  return *m_where;
542 }
543 
545 {
546  return *m_where;
547 }
548 
550 {
551  if(m_groupBy.get() == nullptr)
552  m_groupBy.reset(new GroupBy);
553 
554  m_groupBy->push_back(new GroupByItem(item));
555 
556  return *this;
557 }
558 
560 {
561  if(m_groupBy.get() == nullptr)
562  m_groupBy.reset(new GroupBy);
563 
564  m_groupBy->push_back(item);
565 
566  return *this;
567 }
568 
570 {
571  if(m_groupBy.get() == nullptr)
572  m_groupBy.reset(new GroupBy);
573 
574  m_groupBy->push_back(new GroupByItem(e));
575 
576  return *this;
577 }
578 
579 te::da::Select& te::da::Select::groupBy(const std::string& propertyName)
580 {
581  if(m_groupBy.get() == nullptr)
582  m_groupBy.reset(new GroupBy);
583 
584  m_groupBy->push_back(new GroupByItem(new PropertyName(propertyName)));
585 
586  return *this;
587 }
588 
590 {
591  m_groupBy.reset(gb);
592  return *this;
593 }
594 
596 {
597  m_groupBy.reset(new GroupBy(rhs));
598  return *this;
599 }
600 
602 {
603  return *m_groupBy;
604 }
605 
607 {
608  return *m_groupBy;
609 }
610 
612 {
613  if(m_having.get() == nullptr)
614  m_having.reset(new Having(e));
615  else
616  m_having->setExp(e);
617 
618  return *this;
619 }
620 
622 {
623  if(m_having.get() == nullptr)
624  m_having.reset(new Having(e));
625  else
626  m_having->setExp(e.clone());
627 
628  return *this;
629 }
630 
632 {
633  m_having.reset(h);
634  return *this;
635 }
636 
638 {
639  m_having.reset(new Having(rhs));
640  return *this;
641 }
642 
644 {
645  return *m_having;
646 }
647 
649 {
650  return *m_having;
651 }
652 
654 {
655  if(m_orderBy.get() == nullptr)
656  m_orderBy.reset(new OrderBy);
657 
658  m_orderBy->push_back(new OrderByItem(item));
659 
660  return *this;
661 }
662 
664 {
665  if(m_orderBy.get() == nullptr)
666  m_orderBy.reset(new OrderBy);
667 
668  m_orderBy->push_back(item);
669 
670  return *this;
671 }
672 
674 {
675  if(m_orderBy.get() == nullptr)
676  m_orderBy.reset(new OrderBy);
677 
678  m_orderBy->push_back(new OrderByItem(e, o));
679 
680  return *this;
681 }
682 
683 te::da::Select& te::da::Select::orderBy(const std::string& propertyName, SortOrder o )
684 {
685  if(m_orderBy.get() == nullptr)
686  m_orderBy.reset(new OrderBy);
687 
688  m_orderBy->push_back(new OrderByItem(new PropertyName(propertyName), o));
689 
690  return *this;
691 }
692 
694 {
695  m_orderBy.reset(o);
696  return *this;
697 }
698 
700 {
701  m_orderBy.reset(new OrderBy(rhs));
702  return *this;
703 }
704 
706 {
707  return *m_orderBy;
708 }
709 
711 {
712  return *m_orderBy;
713 }
714 
716 {
717  if(m_distinct.get() == nullptr)
718  m_distinct.reset(new Distinct);
719 
720  m_distinct->push_back(e);
721 
722  return *this;
723 }
724 
726 {
727  if(m_distinct.get() == nullptr)
728  m_distinct.reset(new Distinct);
729 
730  m_distinct->push_back(e.clone());
731 
732  return *this;
733 }
734 
735 te::da::Select& te::da::Select::distinct(const std::string& propertyName)
736 {
737  if(m_distinct.get() == nullptr)
738  m_distinct.reset(new Distinct);
739 
740  m_distinct->push_back(new PropertyName(propertyName));
741 
742  return *this;
743 }
744 
746 {
747  m_distinct.reset(d);
748  return *this;
749 }
750 
752 {
753  m_distinct.reset(new Distinct(rhs));
754  return *this;
755 }
756 
758 {
759  return *m_distinct;
760 }
761 
763 {
764  return *m_distinct;
765 }
766 
768 {
769  m_limit = l;
770  return *this;
771 }
772 
774 {
775  m_offset = i;
776  return *this;
777 }
778 
780 {
781  m_fields.reset(f);
782 }
783 
785 {
786  return m_fields.get();
787 }
788 
790 {
791  m_from.reset(f);
792 }
793 
795 {
796  return m_from.get();
797 }
798 
800 {
801  m_where.reset(w);
802 }
803 
805 {
806  return m_where.get();
807 }
808 
810 {
811  m_groupBy.reset(g);
812 }
813 
815 {
816  return m_groupBy.get();
817 }
818 
820 {
821  m_having.reset(h);
822 }
823 
825 {
826  return m_having.get();
827 }
828 
830 {
831  m_orderBy.reset(o);
832 }
833 
835 {
836  return m_orderBy.get();
837 }
838 
840 {
841  m_distinct.reset(d);
842 }
843 
845 {
846  return m_distinct.get();
847 }
848 
849 void te::da::Select::setLimit(std::size_t m)
850 {
851  m_limit = m;
852 }
853 
854 std::size_t te::da::Select::getLimit() const
855 {
856  return m_limit;
857 }
858 
859 void te::da::Select::setOffset(std::size_t o)
860 {
861  m_offset = o;
862 }
863 
864 std::size_t te::da::Select::getOffset() const
865 {
866  return m_offset;
867 }
868 
870 {
871  from(f);
872  return *this;
873 }
874 
876 {
877  from(f);
878  return *this;
879 }
880 
882 {
883  where(w);
884  return *this;
885 }
886 
888 {
889  where(w);
890  return *this;
891 }
892 
894 {
895  groupBy(g);
896  return *this;
897 }
898 
900 {
901  groupBy(g);
902  return *this;
903 }
904 
906 {
907  having(h);
908  return *this;
909 }
910 
912 {
913  having(h);
914  return *this;
915 }
916 
918 {
919  orderBy(o);
920  return *this;
921 }
922 
924 {
925  orderBy(o);
926  return *this;
927 }
928 
A class that can be used to model a filter expression that can be applied to a query.
Definition: Having.h:47
const Distinct * getDistinct() const
It returns the Distinct modifier.
Definition: Select.cpp:844
GroupBy & groupBy()
Definition: Select.cpp:601
std::unique_ptr< Having > m_having
Definition: Select.h:442
boost::ptr_vector< GroupByItem > GroupBy
A class that can be used to model a GROUP BY clause.
Definition: GroupBy.h:37
An abstract class that models a source of data in a query.
const OrderBy * getOrderBy() const
It returns the list of expressions used to sort the output result.
Definition: Select.cpp:834
A class that can be used in a GROUP BY clause.
Definition: GroupByItem.h:50
An abstract class that models a source of data in a query.
Definition: FromItem.h:50
The Field class can be used to model an expression that takes part of the output items of a SELECT...
std::unique_ptr< Distinct > m_distinct
Definition: Select.h:444
A class that models the name of a dataset used in a From clause.
Definition: DataSetName.h:43
A class that models the name of any property of an object.
const GroupBy * getGroupBy() const
It returns the list of expressions used to condense the result set.
Definition: Select.cpp:814
boost::ptr_vector< Expression > Distinct
A class that models a Distinct clause on a query.
Definition: Distinct.h:37
A class that models the name of any property of an object.
virtual Expression * clone() const =0
It creates a new copy of this expression.
A class that models the name of a dataset used in a From clause.
A class that models a Distinct clause on a query.
boost::ptr_vector< OrderByItem > OrderBy
A class that can be used to model an ORDER BY clause.
Definition: OrderBy.h:37
~Select()
Destructor.
void setLimit(std::size_t m)
It specifies the maximum number of rows to return.
Definition: Select.cpp:849
Select & LeftJoin(FromItem *d2, JoinCondition *c)
Definition: Select.cpp:457
std::size_t m_limit
Definition: Select.h:445
TE_DEFINE_VISITABLE Select()
Default constructor.
Definition: Select.cpp:40
Select & operator()(const Field &f)
Definition: Select.cpp:303
Select & FullOuterJoin(FromItem *d2, JoinCondition *c)
Definition: Select.cpp:477
const From * getFrom() const
It returns the list of source information to be used by the query.
Definition: Select.cpp:794
This is an abstract class that models a query expression.
virtual FromItem * clone() const =0
It creates a new copy of this FromItem.
OrderBy & orderBy()
Definition: Select.cpp:705
void setWhere(Where *w)
It sets the filter codition.
Definition: Select.cpp:799
A Having is a filter expression that can be applied to a query with a group by clause.
std::size_t m_offset
Definition: Select.h:446
Select & NaturalJoin(FromItem *d2, JoinType t)
Definition: Select.cpp:497
Select & InnerJoin(FromItem *d2, JoinCondition *c)
Definition: Select.cpp:447
A condition to be used in a Join clause.
Definition: JoinCondition.h:44
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
Definition: Fields.h:37
JoinType
The type of join in a query.
Select & CrossJoin(FromItem *d2)
Definition: Select.cpp:487
void setDistinct(Distinct *d)
If Distinct is specified, all duplicate rows are removed from the result set (one row is kept from ea...
Definition: Select.cpp:839
A class that can be used to model a filter expression that can be applied to a query.
Definition: Where.h:47
This is an abstract class that models a query expression.
std::size_t getOffset() const
It tells the number of rows to skip before starting to return rows.
Definition: Select.cpp:864
const Fields * getFields() const
It returns the list of output expressions used to form the result set.
Definition: Select.cpp:784
A class that can be used in a GROUP BY clause.
Query * clone() const
It creates a new copy of this query.
Definition: Select.cpp:276
A Select models a query to be used when retrieving data from a data source.
SortOrder
Sort order type: asc or desc.
void setGroupBy(GroupBy *g)
It sets the list of expressions used to condense the result set.
Definition: Select.cpp:809
void setOrderBy(OrderBy *o)
It sets the list of expressions used to sort the output result.
Definition: Select.cpp:829
std::unique_ptr< Fields > m_fields
Definition: Select.h:438
Select & operator=(const Select &rhs)
Definition: Select.cpp:258
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
A class that can be used to model a filter expression that can be applied to a query.
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
Definition: From.h:37
void setOffset(std::size_t o)
It specifies the number of rows to skip before starting to return rows.
Definition: Select.cpp:859
std::unique_ptr< From > m_from
Definition: Select.h:439
Having & having()
Definition: Select.cpp:643
From & from()
Definition: Select.cpp:427
Where * getWhere() const
It returns the filter condition.
Definition: Select.cpp:804
std::unique_ptr< OrderBy > m_orderBy
Definition: Select.h:443
std::unique_ptr< Where > m_where
Definition: Select.h:440
const Having * getHaving() const
It returns the list of expressions used to eliminate group row that doesn&#39;t satisfy the condition...
Definition: Select.cpp:824
std::size_t getLimit() const
It tells the maximum number of rows to return.
Definition: Select.cpp:854
void setHaving(Having *h)
It sets the list of expressions used to eliminate group row that doesn&#39;t satisfy the condition...
Definition: Select.cpp:819
The Field class can be used to model an expression that takes part of the output items of a SELECT...
Select & limit(std::size_t l)
Definition: Select.cpp:767
A class that can be used in an ORDER BY clause to sort the items of a resulting query.
A class that can be used in an ORDER BY clause to sort the items of a resulting query.
Definition: OrderByItem.h:53
Distinct & distinct()
Definition: Select.cpp:757
Select & offset(std::size_t i)
Definition: Select.cpp:773
std::unique_ptr< GroupBy > m_groupBy
Definition: Select.h:441
Select & RightJoin(FromItem *d2, JoinCondition *c)
Definition: Select.cpp:467
Select & operator+(const te::da::From &f)
Definition: Select.cpp:869
A Query is independent from the data source language/dialect.
Definition: Query.h:46
Fields & fields()
Definition: Select.cpp:293
void setFields(Fields *f)
It sets the list of output expressions used to form the result set.
Definition: Select.cpp:779
Where & where()
Definition: Select.cpp:539
Select & Join(FromItem *d2, JoinType t, JoinCondition *c)
Definition: Select.cpp:437
void setFrom(From *f)
It sets the list of source information.
Definition: Select.cpp:789