| QxOrm 1.1.9 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes
qx::QxSqlQuery Class Reference
QxDao : QxOrm library database communication used by persistence engine (ORM - Object Relational Mapping)

qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library, and used by qx::dao::xxx functions to filter elements fetched from database More...

`#include <QxSqlQuery.h>`

List of all members.

## Public Member Functions
| QxSqlQuery ()
| QxSqlQuery (const QString &sQuery)
| QxSqlQuery (const char *sQuery)
virtual | ~QxSqlQuery ()
QString | query () const
bool | isEmpty () const
QxSqlQuery & | query (const QString &sQuery)
QxSqlQuery & | bind (const QVariant &vValue)
QxSqlQuery & | bind (const QString &sKey, const QVariant &vValue)
void | resolve (QSqlQuery &query) const
## Protected Attributes
QString | m_sQuery
| Query SQL with place-holder.
QxCollection< QString, QVariant > | m_lstValue
| Bind value in this array.

## Detailed Description

qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library, and used by qx::dao::xxx functions to filter elements fetched from database

Quick sample using qx::QxSqlQuery class :

    // Create a query to fetch only female author : 'author_id_2' and 'author_id_3'
    qx::QxSqlQuery query("WHERE author.sex = :sex");
    query.bind(":sex", author::female);

    list_author list_of_female_author;
    daoError = qx::dao::fetch_by_query(query, list_of_female_author);
    qAssert(list_of_female_author.count() == 2);

Definition at line 61 of file QxSqlQuery.h.

## Constructor & Destructor Documentation

qx::QxSqlQuery::QxSqlQuery | ( |  | ) | `[inline]`

Definition at line 71 of file QxSqlQuery.h.

qx::QxSqlQuery::QxSqlQuery | ( | const QString & | sQuery | ) | `[inline]`

Definition at line 72 of file QxSqlQuery.h.

qx::QxSqlQuery::QxSqlQuery | ( | const char * | sQuery | ) | `[inline]`

Definition at line 73 of file QxSqlQuery.h.

virtual qx::QxSqlQuery::~QxSqlQuery | ( |  | ) | `[inline, virtual]`

Definition at line 74 of file QxSqlQuery.h.

## Member Function Documentation

QxSqlQuery& qx::QxSqlQuery::bind | ( | const QVariant & | vValue | ) |

QxSqlQuery& qx::QxSqlQuery::bind | ( | const QString & | sKey,
|  | const QVariant & | vValue
| ) |  |

bool qx::QxSqlQuery::isEmpty | ( |  | ) | const`[inline]`

Definition at line 77 of file QxSqlQuery.h.

QString qx::QxSqlQuery::query | ( |  | ) | const`[inline]`

Definition at line 76 of file QxSqlQuery.h.

QxSqlQuery& qx::QxSqlQuery::query | ( | const QString & | sQuery | ) |

void qx::QxSqlQuery::resolve | ( | QSqlQuery & | query | ) | const

## Member Data Documentation

QxCollection<QString, QVariant> qx::QxSqlQuery::m_lstValue`[protected]`

Bind value in this array.

Definition at line 67 of file QxSqlQuery.h.

QString qx::QxSqlQuery::m_sQuery`[protected]`

Query SQL with place-holder.

Definition at line 66 of file QxSqlQuery.h.

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

- D:/Dvlp/_Perso/QxOrm/include/QxDao/QxSqlQuery.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines