TreeFrogFramework  1.18
tsqljoin.h
Go to the documentation of this file.
1 #ifndef TSQLJOIN_H
2 #define TSQLJOIN_H
3 
4 #include <TGlobal>
5 #include <TCriteria>
6 
14 template <class T>
15 class TSqlJoin
16 {
17 public:
18  TSqlJoin();
20  TSqlJoin(TSql::JoinMode joinMode, int joinColumn, const TCriteria &criteria);
21  TSqlJoin(const TSqlJoin &other);
22 
23  TSqlJoin &operator=(const TSqlJoin &other);
24  TSql::JoinMode joinMode() const { return _mode; }
25  int joinColumn() const { return _joinColumn; }
26  TCriteria criteria() const { return _criteria; }
27 
28 private:
29  TSql::JoinMode _mode;
30  int _joinColumn;
31  TCriteria _criteria;
32 };
33 
34 
35 template <class T>
37  : _mode(TSql::InnerJoin), _joinColumn(-1), _criteria()
38 { }
39 
40 template <class T>
42  : _mode(TSql::InnerJoin), _joinColumn(joinColumn), _criteria(criteria)
43 { }
44 
45 template <class T>
47  : _mode(joinMode), _joinColumn(joinColumn), _criteria(criteria)
48 { }
49 
50 template<class T>
51 inline TSqlJoin<T>::TSqlJoin(const TSqlJoin &other)
52  : _mode(other.mode), _joinColumn(other._joinColumn), _criteria(other._criteria)
53 { }
54 
55 template<class T>
57 {
58  _mode = other._mode;
59  _joinColumn = other._joinColumn;
60  _criteria = other._criteria;
61 }
62 
63 #endif // TSQLJOIN_H
TCriteria criteria() const
Definition: tsqljoin.h:26
TSqlJoin & operator=(const TSqlJoin &other)
Definition: tsqljoin.h:56
The TSql namespace contains miscellaneous identifiers used throughout the SQL library.
TSql::JoinMode joinMode() const
Definition: tsqljoin.h:24
Definition: tfnamespace.h:267
int joinColumn() const
Definition: tsqljoin.h:25
JoinMode
Definition: tfnamespace.h:266
The TSqlJoin class represents JOIN clause for combination to a record of other table.
Definition: tsqljoin.h:15
The TCriteria class represents a WHERE clause without SQL for the sake of database abstraction...
Definition: tcriteria.h:8
TSqlJoin()
Definition: tsqljoin.h:36