TreeFrogFramework
2.8
|
#include <tcriteria.h>
Public Member Functions | |
TCriteria () | |
TCriteria (const TCriteria &other) | |
TCriteria (int property, const QVariant &val) | |
TCriteria (int property, TSql::ComparisonOperator op) | |
TCriteria (int property, TSql::ComparisonOperator op, const QVariant &val) | |
TCriteria (int property, TSql::ComparisonOperator op, const QVariant &val1, const QVariant &val2) | |
TCriteria (int property, TSql::ComparisonOperator op1, TSql::ComparisonOperator op2, const QVariant &val) | |
TCriteria (int property, TMongo::ComparisonOperator op) | |
TCriteria (int property, TMongo::ComparisonOperator op, const QVariant &val) | |
~TCriteria () | |
TCriteria & | add (int property, const QVariant &val) |
TCriteria & | add (int property, TSql::ComparisonOperator op) |
TCriteria & | add (int property, TSql::ComparisonOperator op, const QVariant &val) |
TCriteria & | add (int property, TSql::ComparisonOperator op, const QVariant &val1, const QVariant &val2) |
TCriteria & | add (int property, TSql::ComparisonOperator op1, TSql::ComparisonOperator op2, const QVariant &val) |
TCriteria & | add (const TCriteria &criteria) |
TCriteria & | addOr (int property, const QVariant &val) |
TCriteria & | addOr (int property, TSql::ComparisonOperator op) |
TCriteria & | addOr (int property, TSql::ComparisonOperator op, const QVariant &val) |
TCriteria & | addOr (int property, TSql::ComparisonOperator op, const QVariant &val1, const QVariant &val2) |
TCriteria & | addOr (int property, TSql::ComparisonOperator op1, TSql::ComparisonOperator op2, const QVariant &val) |
TCriteria & | addOr (const TCriteria &criteria) |
TCriteria & | add (int property, TMongo::ComparisonOperator op) |
TCriteria & | add (int property, TMongo::ComparisonOperator op, const QVariant &val) |
TCriteria & | addOr (int property, TMongo::ComparisonOperator op) |
TCriteria & | addOr (int property, TMongo::ComparisonOperator op, const QVariant &val) |
bool | isEmpty () const |
void | clear () |
const TCriteria | operator&& (const TCriteria &criteria) const |
const TCriteria | operator|| (const TCriteria &criteria) const |
const TCriteria | operator! () const |
TCriteria & | operator= (const TCriteria &other) |
Protected Types | |
enum | LogicalOperator { None = 0 , And , Or , Not } |
Protected Member Functions | |
const QVariant & | first () const |
const QVariant & | second () const |
LogicalOperator | logicalOperator () const |
TCriteria & | add (LogicalOperator op, const TCriteria &criteria) |
Friends | |
template<class T > | |
class | TCriteriaConverter |
template<class T > | |
class | TCriteriaMongoConverter |
The TCriteria class represents a WHERE clause without SQL for the sake of database abstraction.
|
protected |
TCriteria::TCriteria | ( | ) |
Constructor.
TCriteria::TCriteria | ( | const TCriteria & | other | ) |
Copy constructor.
TCriteria::TCriteria | ( | int | property, |
const QVariant & | val | ||
) |
Constructs a criteria initialized with a WHERE clause to which a property of ORM object with the index property equals the value val.
TCriteria::TCriteria | ( | int | property, |
TSql::ComparisonOperator | op | ||
) |
Constructs a criteria initialized with a WHERE clause to which a property of ORM object with the index property is NULL value or NOT NULL value.
TCriteria::TCriteria | ( | int | property, |
TSql::ComparisonOperator | op, | ||
const QVariant & | val | ||
) |
Constructs a criteria initialized with a WHERE clause to which a property of ORM object with the index property is compared with the val value by a means of the op parameter.
TCriteria::TCriteria | ( | int | property, |
TSql::ComparisonOperator | op, | ||
const QVariant & | val1, | ||
const QVariant & | val2 | ||
) |
Constructs a criteria initialized with a WHERE clause to which a property of ORM object with the index property is compared with the val1 value and the val2 value by a means of the op parameter.
TCriteria::TCriteria | ( | int | property, |
TSql::ComparisonOperator | op1, | ||
TSql::ComparisonOperator | op2, | ||
const QVariant & | val | ||
) |
Constructs a criteria initialized with a WHERE clause to which a property of ORM object with the index property is compared with the val value by a means of the op1 and op2 parameter.
TCriteria::TCriteria | ( | int | property, |
TMongo::ComparisonOperator | op | ||
) |
TCriteria::TCriteria | ( | int | property, |
TMongo::ComparisonOperator | op, | ||
const QVariant & | val | ||
) |
|
inline |
Adds a WHERE clause of the criteria parameter with the AND operator.
TCriteria & TCriteria::add | ( | int | property, |
const QVariant & | val | ||
) |
Adds a WHERE clause to which a property of ORM object with the index property equals the value val.
TCriteria & TCriteria::add | ( | int | property, |
TMongo::ComparisonOperator | op | ||
) |
TCriteria & TCriteria::add | ( | int | property, |
TMongo::ComparisonOperator | op, | ||
const QVariant & | val | ||
) |
TCriteria & TCriteria::add | ( | int | property, |
TSql::ComparisonOperator | op | ||
) |
Adds a WHERE clause to which a property of ORM object with the index property is NULL value or NOT NULL value.
The op parameter must be TSql::IsNull or TSql::IsNotNull.
TCriteria & TCriteria::add | ( | int | property, |
TSql::ComparisonOperator | op, | ||
const QVariant & | val | ||
) |
Adds a WHERE clause to which a property of ORM object with the index property is compared with the val value by a means of the op parameter.
The op parameter must be one of the following constants:
TSql::Equal, TSql::NotEqual, TSql::LessThan, TSql::GreaterThan, TSql::LessEqual, TSql::GreaterEqual, TSql::Like, TSql::NotLike, TSql::ILike, TSql::NotILike.
TCriteria & TCriteria::add | ( | int | property, |
TSql::ComparisonOperator | op, | ||
const QVariant & | val1, | ||
const QVariant & | val2 | ||
) |
Adds a WHERE clause to which a property of ORM object with the index property is compared with the val1 value and the val2 value by a means of the op parameter.
The op parameter must be one of the following constants:
TSql::LikeEscape, TSql::NotLikeEscape, TSql::ILikeEscape, TSql::NotILikeEscape, TSql::Between, TSql::NotBetween.
TCriteria & TCriteria::add | ( | int | property, |
TSql::ComparisonOperator | op1, | ||
TSql::ComparisonOperator | op2, | ||
const QVariant & | val | ||
) |
|
protected |
Adds a WHERE clause of the criteria parameter with the op operator.
Adds a WHERE clause of the criteria parameter with the OR operator.
TCriteria & TCriteria::addOr | ( | int | property, |
const QVariant & | val | ||
) |
Adds a WHERE clause with OR operator to which a property of ORM object with the index property equals the value val.
TCriteria & TCriteria::addOr | ( | int | property, |
TMongo::ComparisonOperator | op | ||
) |
TCriteria & TCriteria::addOr | ( | int | property, |
TMongo::ComparisonOperator | op, | ||
const QVariant & | val | ||
) |
TCriteria & TCriteria::addOr | ( | int | property, |
TSql::ComparisonOperator | op | ||
) |
Adds a WHERE clause with OR operator to which a property of ORM object with the index property is NULL value or NOT NULL value.
The op parameter must be TSql::IsNull or TSql::IsNotNull.
TCriteria & TCriteria::addOr | ( | int | property, |
TSql::ComparisonOperator | op, | ||
const QVariant & | val | ||
) |
Adds a WHERE clause with OR operator to which a property of ORM object with the index property is compared with the val value by a means of the op parameter.
TCriteria & TCriteria::addOr | ( | int | property, |
TSql::ComparisonOperator | op, | ||
const QVariant & | val1, | ||
const QVariant & | val2 | ||
) |
Adds a WHERE clause with OR operator to which a property of ORM object with the index property is compared with the val1 value and the val2 value by a means of the op parameter.
The op parameter must be one of the following constants:
TSql::LikeEscape, TSql::NotLikeEscape, TSql::ILikeEscape, TSql::NotILikeEscape, TSql::Between, TSql::NotBetween.
TCriteria & TCriteria::addOr | ( | int | property, |
TSql::ComparisonOperator | op1, | ||
TSql::ComparisonOperator | op2, | ||
const QVariant & | val | ||
) |
Adds a WHERE clause with OR operator to which a property of ORM object with the index property is compared with the val value by a means of the op1 and op2 parameter.
This function is used with TSql::Any or TSql::All constant as the op2 parameter to generate a WHERE clause such as "column >= any (10, 20, 50)".
void TCriteria::clear | ( | ) |
Clears the criteria and makes it empty.
|
inlineprotected |
This function is for internal use only.
bool TCriteria::isEmpty | ( | ) | const |
Returns true if the criteria has no data; otherwise returns false.
|
inlineprotected |
This function is for internal use only.
const TCriteria TCriteria::operator! | ( | ) | const |
Returns a WHERE clause that negated this criteria.
Adds a WHERE clause of the criteria parameter with the AND operator.
Adds a WHERE clause of the criteria parameter with the OR operator.
|
inlineprotected |
This function is for internal use only.
|
friend |
|
friend |