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