QDjango
Public Types | Public Member Functions | Friends | List of all members
QDjangoWhere Class Reference

The QDjangoWhere class expresses an SQL constraint. More...

#include <QDjangoWhere.h>

Public Types

enum  Operation {
  None, Equals, NotEquals, GreaterThan,
  LessThan, GreaterOrEquals, LessOrEquals, StartsWith,
  EndsWith, Contains, IsIn, IsNull,
  IEquals, INotEquals, IStartsWith, IEndsWith,
  IContains
}
 A comparison operation on a database column value. More...
 

Public Member Functions

 QDjangoWhere ()
 
 QDjangoWhere (const QDjangoWhere &other)
 
 QDjangoWhere (const QString &key, QDjangoWhere::Operation operation, QVariant value)
 
 ~QDjangoWhere ()
 
QDjangoWhereoperator= (const QDjangoWhere &other)
 
QDjangoWhere operator! () const
 
QDjangoWhere operator&& (const QDjangoWhere &other) const
 
QDjangoWhere operator|| (const QDjangoWhere &other) const
 
void bindValues (QDjangoQuery &query) const
 
bool isAll () const
 
bool isNone () const
 
QString sql (const QSqlDatabase &db) const
 
QString toString () const
 

Friends

class QDjangoCompiler
 

Detailed Description

The QDjangoWhere class expresses an SQL constraint.

The QDjangoWhere class is used to build SQL WHERE statements. In its simplest form a QDjangoWhere expresses a constraint on a column value.

QDjangoWhere instances can be negated using the "!" unary operator or combined using the "&&" and "||" boolean operators.

Constructor & Destructor Documentation

QDjangoWhere::QDjangoWhere ( )

Constructs an empty QDjangoWhere, which expresses no constraint.

QDjangoWhere::QDjangoWhere ( const QDjangoWhere other)

Constructs a copy of other.

QDjangoWhere::QDjangoWhere ( const QString &  key,
QDjangoWhere::Operation  operation,
QVariant  value 
)

Constructs a QDjangoWhere expressing a constraint on a database column.

Parameters
key
operation
value
QDjangoWhere::~QDjangoWhere ( )

Destroys a QDjangoWhere.

Member Function Documentation

void QDjangoWhere::bindValues ( QDjangoQuery &  query) const

Bind the values associated with this QDjangoWhere to the given query.

Parameters
query
bool QDjangoWhere::isAll ( ) const

Returns true if the current QDjangoWhere does not express any constraint.

bool QDjangoWhere::isNone ( ) const

Returns true if the current QDjangoWhere expressed an impossible constraint.

QDjangoWhere QDjangoWhere::operator! ( ) const

Negates the current QDjangoWhere.

QDjangoWhere QDjangoWhere::operator&& ( const QDjangoWhere other) const

Combines the current QDjangoWhere with the other QDjangoWhere using a logical AND.

Parameters
other
QDjangoWhere & QDjangoWhere::operator= ( const QDjangoWhere other)

Assigns other to this QDjangoWhere.

QDjangoWhere QDjangoWhere::operator|| ( const QDjangoWhere other) const

Combines the current QDjangoWhere with the other QDjangoWhere using a logical OR.

Parameters
other
QString QDjangoWhere::sql ( const QSqlDatabase &  db) const

Returns the SQL code corresponding for the current QDjangoWhere.


The documentation for this class was generated from the following files: