| QxOrm 1.4.4 C++ Object Relational Mapping library

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

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

Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | Friends
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.

## Classes
struct | QxSqlResult
## Public Member Functions
| QxSqlQuery ()
| QxSqlQuery (const QString &sQuery)
| QxSqlQuery (const char *sQuery)
virtual | ~QxSqlQuery ()
QString | query ()
bool | isEmpty () const
bool | isDistinct () const
void | clear ()
void | resolve (QSqlQuery &query) const
void | resolveOutput (QSqlQuery &query, bool bFetchSqlResult)
void | postProcess (QString &sql) const
QxSqlQuery & | query (const QString &sQuery)
QxSqlQuery & | bind (const QVariant &vValue, QSql::ParamType paramType=QSql::In)
QxSqlQuery & | bind (const QString &sKey, const QVariant &vValue, QSql::ParamType paramType=QSql::In)
QVariant | boundValue (const QString &sKey) const
QVariant | boundValue (int iPosition) const
long | getSqlResultRowCount () const
long | getSqlResultColumnCount () const
QVariant | getSqlResultAt (long row, long column) const
QVariant | getSqlResultAt (long row, const QString &column) const
QVector< QVariant > | getSqlResultAt (long row) const
QVector< QString > | getSqlResultAllColumns () const
void | dumpSqlResult ()
virtual QxSqlQuery & | distinct ()
virtual QxSqlQuery & | where (const QString &column)
virtual QxSqlQuery & | where_OpenParenthesis (const QString &column)
virtual QxSqlQuery & | and_ (const QString &column)
virtual QxSqlQuery & | and_OpenParenthesis (const QString &column)
virtual QxSqlQuery & | or_ (const QString &column)
virtual QxSqlQuery & | or_OpenParenthesis (const QString &column)
virtual QxSqlQuery & | openParenthesis ()
virtual QxSqlQuery & | closeParenthesis ()
virtual QxSqlQuery & | orderAsc (const QStringList &columns)
virtual QxSqlQuery & | orderAsc (const QString &col1)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3, const QString &col4)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7, const QString &col8)
virtual QxSqlQuery & | orderAsc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7, const QString &col8, const QString &col9)
virtual QxSqlQuery & | orderDesc (const QStringList &columns)
virtual QxSqlQuery & | orderDesc (const QString &col1)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3, const QString &col4)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7, const QString &col8)
virtual QxSqlQuery & | orderDesc (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7, const QString &col8, const QString &col9)
virtual QxSqlQuery & | groupBy (const QStringList &columns)
virtual QxSqlQuery & | groupBy (const QString &col1)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3, const QString &col4)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7, const QString &col8)
virtual QxSqlQuery & | groupBy (const QString &col1, const QString &col2, const QString &col3, const QString &col4, const QString &col5, const QString &col6, const QString &col7, const QString &col8, const QString &col9)
virtual QxSqlQuery & | limit (int rowsCount, int startRow=0)
virtual QxSqlQuery & | like (const QString &val)
virtual QxSqlQuery & | notLike (const QString &val)
virtual QxSqlQuery & | startsWith (const QString &val)
virtual QxSqlQuery & | endsWith (const QString &val)
virtual QxSqlQuery & | containsString (const QString &val)
virtual QxSqlQuery & | isEqualTo (const QVariant &val)
virtual QxSqlQuery & | isNotEqualTo (const QVariant &val)
virtual QxSqlQuery & | isGreaterThan (const QVariant &val)
virtual QxSqlQuery & | isGreaterThanOrEqualTo (const QVariant &val)
virtual QxSqlQuery & | isLessThan (const QVariant &val)
virtual QxSqlQuery & | isLessThanOrEqualTo (const QVariant &val)
virtual QxSqlQuery & | customOperator (const QString &sCustomOperator, const QVariant &val)
virtual QxSqlQuery & | in (const QVariantList &values)
virtual QxSqlQuery & | in (const QVariant &val1)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6, const QVariant &val7)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6, const QVariant &val7, const QVariant &val8)
virtual QxSqlQuery & | in (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6, const QVariant &val7, const QVariant &val8, const QVariant &val9)
virtual QxSqlQuery & | notIn (const QVariantList &values)
virtual QxSqlQuery & | notIn (const QVariant &val1)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6, const QVariant &val7)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6, const QVariant &val7, const QVariant &val8)
virtual QxSqlQuery & | notIn (const QVariant &val1, const QVariant &val2, const QVariant &val3, const QVariant &val4, const QVariant &val5, const QVariant &val6, const QVariant &val7, const QVariant &val8, const QVariant &val9)
virtual QxSqlQuery & | in_Select (const QString &sql)
virtual QxSqlQuery & | notIn_Select (const QString &sql)
virtual QxSqlQuery & | isNull ()
virtual QxSqlQuery & | isNotNull ()
virtual QxSqlQuery & | isBetween (const QVariant &val1, const QVariant &val2)
virtual QxSqlQuery & | isNotBetween (const QVariant &val1, const QVariant &val2)
virtual QxSqlQuery & | freeText (const QString &text)
## Static Public Member Functions
static void | dumpBoundValues (const QSqlQuery &query)
## Protected Types
typedef std::tuple< QVariant, QSql::ParamType > | type_bind_value
## Protected Attributes
QString | m_sQuery
| Query SQL with place-holder.
QxCollection< QString, type_bind_value > | m_lstValue
| Bind value in this array.
qx::dao::detail::IxSqlElement_ptr | m_pSqlElementTemp
| Temporary SQL element.
QList < qx::dao::detail::IxSqlElement_ptr > | m_lstSqlElement
| List of all SQL elements to build SQL query.
int | m_iSqlElementIndex
| Current index of SQL element.
int | m_iParenthesisCount
| Current parenthesis count.
bool | m_bDistinct
| Replace SELECT by SELECT DISTINCT in SQL query.
std::shared_ptr< QxSqlResult > | m_pSqlResult
| All results returning by SQL query or stored procedure (after calling qx::dao::call_query function)
## Private Member Functions
void | verifyQuery () const QX_USED
void | fetchSqlResult (QSqlQuery &query)
QxSqlQuery & | addSqlExpression (const QString &column, qx::dao::detail::QxSqlExpression::type type)
QxSqlQuery & | addSqlCompare (const QVariant &val, qx::dao::detail::QxSqlCompare::type type, const QString &sCustomOperator=QString())
QxSqlQuery & | addSqlSort (const QStringList &columns, qx::dao::detail::QxSqlSort::type type)
QxSqlQuery & | addSqlIn (const QVariantList &values, qx::dao::detail::QxSqlIn::type type)
QxSqlQuery & | addSqlIsNull (qx::dao::detail::QxSqlIsNull::type type)
QxSqlQuery & | addSqlIsBetween (const QVariant &val1, const QVariant &val2, qx::dao::detail::QxSqlIsBetween::type type)
## Friends
struct | qx::cvt::detail::QxConvert_ToJson< qx::QxSqlQuery >
struct | qx::cvt::detail::QxConvert_FromJson< qx::QxSqlQuery >
template<class Archive >
void | boost::serialization::qx_save (Archive &ar, const qx::QxSqlQuery &t, const unsigned int file_version)
template<class Archive >
void | boost::serialization::qx_load (Archive &ar, qx::QxSqlQuery &t, const unsigned int file_version)
QDataStream & | operator<< (QDataStream &stream, const qx::QxSqlQuery &t)
QDataStream & | operator>> (QDataStream &stream, qx::QxSqlQuery &t)
QJsonValue | qx::cvt::detail::QxConvert_ToJson_Helper (const qx::QxSqlQuery &t, const QString &format)
qx_bool | qx::cvt::detail::QxConvert_FromJson_Helper (const QJsonValue &j, qx::QxSqlQuery &t, const QString &format)

## 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

The class qx::QxSqlQuery (or its typedef qx_query) is used to communicate with database (to filter, to sort, etc.) in two different ways :

- writing manually SQL query ;
- using C++ methods with a syntax similar to SQL (same concept than the great library SubSonic for .Net).

With the first method (writing manually SQL query), you can use some optimizations specific for each database. The second method (using C++ code to build SQL query) binds automatically SQL parameters without using qx::QxSqlQuery::bind() function.

Here is an example with qx::QxSqlQuery class writing manually a SQL query :

    // Build a SQL query to fetch only 'author' of type 'female'
    qx::QxSqlQuery query("WHERE author.sex = :sex");
    query.bind(":sex", author::female);

    QList<author> list_of_female;
    QSqlError daoError = qx::dao::fetch_by_query(query, list_of_female);

    // Here we can work with the collection provided by database
    for (long l = 0; l < list_of_female.count(); l++) { ; }

QxOrm library provides 3 styles to write SQL parameters. This style can be modified for a project using the following method qx::QxSqlDatabase::getSingleton()->setSqlPlaceHolderStyle() :

- ph_style_2_point_name : "WHERE author.sex = :sex" (default style) ;
- ph_style_at_name : "WHERE author.sex = @sex" ;
- ph_style_question_mark : "WHERE author.sex = ?".

Here is the same example using C++ code of the class qx::QxSqlQuery (or its typedef qx_query) to build query automatically :

    // Build a SQL query to fetch only 'author' of type 'female'
    qx_query query;
    query.where("author.sex").isEqualTo(author::female);

    QList<author> list_of_female;
    QSqlError daoError = qx::dao::fetch_by_query(query, list_of_female);

    // Here we can work with the collection provided by database
    for (long l = 0; l < list_of_female.count(); l++) { ; }

With C++ methods of qx::QxSqlQuery class, you don't have to bind any SQL parameter, and the syntax is similar to real SQL. All SQL parameters will be provided to database automatically with the following style : qx::QxSqlDatabase::getSingleton()->getSqlPlaceHolderStyle().

Here is an example with many methods of qx::QxSqlQuery class (or its typedef qx_query) :

    qx_query query;
    query.where("sex").isEqualTo(author::female)
         .and_("age").isGreaterThan(38)
         .or_("last_name").isNotEqualTo("Dupont")
         .or_("first_name").like("Alfred")
         .and_OpenParenthesis("id").isLessThanOrEqualTo(999)
         .and_("birth_date").isBetween(date1, date2)
         .closeParenthesis()
         .or_("id").in(50, 999, 11, 23, 78945)
         .and_("is_deleted").isNotNull()
         .orderAsc("last_name", "first_name", "sex")
         .limit(50, 150);

This code will produce following SQL for MySQL, PostgreSQL and SQLite databases (for Oracle and SQLServer, there is a specific process for limit() method) :

    WHERE sex = :sex_1_0
    AND age > :age_3_0
    OR last_name <> :last_name_5_0
    OR first_name LIKE :first_name_7_0
    AND ( id <= :id_10_0 AND birth_date BETWEEN :birth_date_12_0_1 AND :birth_date_12_0_2 )
    OR id IN (:id_15_0_0, :id_15_0_1, :id_15_0_2, :id_15_0_3, :id_15_0_4)
    AND is_deleted IS NOT NULL
    ORDER BY last_name ASC, first_name ASC, sex ASC
    LIMIT :limit_rows_count_19_0 OFFSET :offset_start_row_19_0

Here is the list of all functions available to use qx::QxSqlQuery class (or its typedef qx_query) :

    // with functions into namespace qx::dao
    qx::dao::count<T>()
    qx::dao::fetch_by_query<T>()
    qx::dao::update_by_query<T>()
    qx::dao::delete_by_query<T>()
    qx::dao::destroy_by_query<T>()
    qx::dao::fetch_by_query_with_relation<T>()
    qx::dao::fetch_by_query_with_all_relation<T>()
    qx::dao::update_by_query_with_relation<T>()
    qx::dao::update_by_query_with_all_relation<T>()
    qx::dao::update_optimized_by_query<T>()

    // with qx::QxSession class
    qx::QxSession::count<T>()
    qx::QxSession::fetchByQuery<T>()
    qx::QxSession::update<T>()
    qx::QxSession::deleteByQuery<T>()
    qx::QxSession::destroyByQuery<T>()

    // with qx::QxRepository<T> class
    qx::QxRepository<T>::count()
    qx::QxRepository<T>::fetchByQuery()
    qx::QxRepository<T>::update()
    qx::QxRepository<T>::deleteByQuery()
    qx::QxRepository<T>::destroyByQuery()

Note : those functions have 2 other optionals parameters :

- const QStringList & columns : to indicate columns to fetch (by default, all columns are fetched) ;
- const QStringList & relation : to indicate relations to fetch (one-to-one, one-to-many, many-to-one and many-to-many defined into void qx::register_class<T>() mapping function by class), by default there is no relation fetched.

Other note : it's possible to call a stored procedure using qx::QxSqlQuery class, for example :

    qx_query query("CALL MyStoredProc(:param1, :param2)");
    query.bind(":param1", "myValue1");
    query.bind(":param2", 5024, QSql::InOut);
    QSqlError daoError = qx::dao::call_query(query);
    QVariant vNewValue = query.boundValue(":param2");
    query.dumpSqlResult();

If the stored procedure returns a resultset, you can iterate over each rows and fields using the following methods (after calling qx::dao::call_query() function) :

- long qx::QxSqlQuery::getSqlResultRowCount() const;
- long qx::QxSqlQuery::getSqlResultColumnCount() const;
- QVariant qx::QxSqlQuery::getSqlResultAt(long row, long column) const;
- QVariant qx::QxSqlQuery::getSqlResultAt(long row, const QString & column) const;
- QVector qx::QxSqlQuery::getSqlResultAllColumns() const;
- void qx::QxSqlQuery::dumpSqlResult();

Other note : to add your own SQL query methods (for example, some databases provide non-standard specifics SQL functions) :

- create a derived class based on qx::QxSqlQuery class ;
- if your C++ compiler supports covariant return type, add the macro QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_HPP(myClass) in the definition of your class (myClass.h) ;
- if your C++ compiler supports covariant return type, add the macro QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_CPP(myClass) in the implementation of your class (myClass.cpp) ;
- add all SQL specifics functions in your derived class.

Definition at line 237 of file QxSqlQuery.h.

## Member Typedef Documentation

typedef std::tuple<QVariant, QSql::ParamType> qx::QxSqlQuery::type_bind_value`[protected]`

Definition at line 260 of file QxSqlQuery.h.

## Constructor & Destructor Documentation

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

Definition at line 273 of file QxSqlQuery.h.

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

Definition at line 274 of file QxSqlQuery.h.

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

Definition at line 275 of file QxSqlQuery.h.

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

Definition at line 276 of file QxSqlQuery.h.

## Member Function Documentation

QxSqlQuery& qx::QxSqlQuery::addSqlCompare | ( | const QVariant & | val,
|  | qx::dao::detail::QxSqlCompare::type | type,
|  | const QString & | sCustomOperator = `QString()`
| ) |  | `[private]`

QxSqlQuery& qx::QxSqlQuery::addSqlExpression | ( | const QString & | column,
|  | qx::dao::detail::QxSqlExpression::type | type
| ) |  | `[private]`

QxSqlQuery& qx::QxSqlQuery::addSqlIn | ( | const QVariantList & | values,
|  | qx::dao::detail::QxSqlIn::type | type
| ) |  | `[private]`

QxSqlQuery& qx::QxSqlQuery::addSqlIsBetween | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | qx::dao::detail::QxSqlIsBetween::type | type
| ) |  | `[private]`

QxSqlQuery& qx::QxSqlQuery::addSqlIsNull | ( | qx::dao::detail::QxSqlIsNull::type | type | ) | `[private]`

QxSqlQuery& qx::QxSqlQuery::addSqlSort | ( | const QStringList & | columns,
|  | qx::dao::detail::QxSqlSort::type | type
| ) |  | `[private]`

virtual QxSqlQuery& qx::QxSqlQuery::and_ | ( | const QString & | column | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::and_OpenParenthesis | ( | const QString & | column | ) | `[virtual]`

QxSqlQuery& qx::QxSqlQuery::bind | ( | const QVariant & | vValue,
|  | QSql::ParamType | paramType = `QSql::In`
| ) |  |

QxSqlQuery& qx::QxSqlQuery::bind | ( | const QString & | sKey,
|  | const QVariant & | vValue,
|  | QSql::ParamType | paramType = `QSql::In`
| ) |  |

QVariant qx::QxSqlQuery::boundValue | ( | const QString & | sKey | ) | const

QVariant qx::QxSqlQuery::boundValue | ( | int | iPosition | ) | const

void qx::QxSqlQuery::clear | ( |  | ) |

virtual QxSqlQuery& qx::QxSqlQuery::closeParenthesis | ( |  | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::containsString | ( | const QString & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::customOperator | ( | const QString & | sCustomOperator,
|  | const QVariant & | val
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::distinct | ( |  | ) | `[virtual]`

static void qx::QxSqlQuery::dumpBoundValues | ( | const QSqlQuery & | query | ) | `[static]`

void qx::QxSqlQuery::dumpSqlResult | ( |  | ) |

virtual QxSqlQuery& qx::QxSqlQuery::endsWith | ( | const QString & | val | ) | `[virtual]`

void qx::QxSqlQuery::fetchSqlResult | ( | QSqlQuery & | query | ) | `[private]`

virtual QxSqlQuery& qx::QxSqlQuery::freeText | ( | const QString & | text | ) | `[virtual]`

QVector<QString> qx::QxSqlQuery::getSqlResultAllColumns | ( |  | ) | const

QVariant qx::QxSqlQuery::getSqlResultAt | ( | long | row,
|  | long | column
| ) |  | const

QVariant qx::QxSqlQuery::getSqlResultAt | ( | long | row,
|  | const QString & | column
| ) |  | const

QVector<QVariant> qx::QxSqlQuery::getSqlResultAt | ( | long | row | ) | const

long qx::QxSqlQuery::getSqlResultColumnCount | ( |  | ) | const

long qx::QxSqlQuery::getSqlResultRowCount | ( |  | ) | const

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QStringList & | columns | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1 | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7,
|  | const QString & | col8
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::groupBy | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7,
|  | const QString & | col8,
|  | const QString & | col9
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariantList & | values | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1 | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6,
|  | const QVariant & | val7
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6,
|  | const QVariant & | val7,
|  | const QVariant & | val8
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6,
|  | const QVariant & | val7,
|  | const QVariant & | val8,
|  | const QVariant & | val9
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::in_Select | ( | const QString & | sql | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isBetween | ( | const QVariant & | val1,
|  | const QVariant & | val2
| ) |  | `[virtual]`

bool qx::QxSqlQuery::isDistinct | ( |  | ) | const

bool qx::QxSqlQuery::isEmpty | ( |  | ) | const

virtual QxSqlQuery& qx::QxSqlQuery::isEqualTo | ( | const QVariant & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isGreaterThan | ( | const QVariant & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isGreaterThanOrEqualTo | ( | const QVariant & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isLessThan | ( | const QVariant & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isLessThanOrEqualTo | ( | const QVariant & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isNotBetween | ( | const QVariant & | val1,
|  | const QVariant & | val2
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isNotEqualTo | ( | const QVariant & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isNotNull | ( |  | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::isNull | ( |  | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::like | ( | const QString & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::limit | ( | int | rowsCount,
|  | int | startRow = `0`
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariantList & | values | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1 | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6,
|  | const QVariant & | val7
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6,
|  | const QVariant & | val7,
|  | const QVariant & | val8
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn | ( | const QVariant & | val1,
|  | const QVariant & | val2,
|  | const QVariant & | val3,
|  | const QVariant & | val4,
|  | const QVariant & | val5,
|  | const QVariant & | val6,
|  | const QVariant & | val7,
|  | const QVariant & | val8,
|  | const QVariant & | val9
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notIn_Select | ( | const QString & | sql | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::notLike | ( | const QString & | val | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::openParenthesis | ( |  | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::or_ | ( | const QString & | column | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::or_OpenParenthesis | ( | const QString & | column | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QStringList & | columns | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1 | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7,
|  | const QString & | col8
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderAsc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7,
|  | const QString & | col8,
|  | const QString & | col9
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QStringList & | columns | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1 | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7,
|  | const QString & | col8
| ) |  | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::orderDesc | ( | const QString & | col1,
|  | const QString & | col2,
|  | const QString & | col3,
|  | const QString & | col4,
|  | const QString & | col5,
|  | const QString & | col6,
|  | const QString & | col7,
|  | const QString & | col8,
|  | const QString & | col9
| ) |  | `[virtual]`

void qx::QxSqlQuery::postProcess | ( | QString & | sql | ) | const

QString qx::QxSqlQuery::query | ( |  | ) |

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

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

void qx::QxSqlQuery::resolveOutput | ( | QSqlQuery & | query,
|  | bool | bFetchSqlResult
| ) |  |

virtual QxSqlQuery& qx::QxSqlQuery::startsWith | ( | const QString & | val | ) | `[virtual]`

void qx::QxSqlQuery::verifyQuery | ( |  | ) | const`[private]`

virtual QxSqlQuery& qx::QxSqlQuery::where | ( | const QString & | column | ) | `[virtual]`

virtual QxSqlQuery& qx::QxSqlQuery::where_OpenParenthesis | ( | const QString & | column | ) | `[virtual]`

## Friends And Related Function Documentation

template<class Archive >

void boost::serialization::qx_load | ( | Archive & | ar,
|  | qx::QxSqlQuery & | t,
|  | const unsigned int | file_version
| ) |  | `[friend]`

template<class Archive >

void boost::serialization::qx_save | ( | Archive & | ar,
|  | const qx::QxSqlQuery & | t,
|  | const unsigned int | file_version
| ) |  | `[friend]`

QDataStream& operator<< | ( | QDataStream & | stream,
|  | const qx::QxSqlQuery & | t
| ) |  | `[friend]`

QDataStream& operator>> | ( | QDataStream & | stream,
|  | qx::QxSqlQuery & | t
| ) |  | `[friend]`

friend struct qx::cvt::detail::QxConvert_FromJson< qx::QxSqlQuery >`[friend]`

Definition at line 250 of file QxSqlQuery.h.

qx_bool qx::cvt::detail::QxConvert_FromJson_Helper | ( | const QJsonValue & | j,
|  | qx::QxSqlQuery & | t,
|  | const QString & | format
| ) |  | `[friend]`

friend struct qx::cvt::detail::QxConvert_ToJson< qx::QxSqlQuery >`[friend]`

Definition at line 249 of file QxSqlQuery.h.

QJsonValue qx::cvt::detail::QxConvert_ToJson_Helper | ( | const qx::QxSqlQuery & | t,
|  | const QString & | format
| ) |  | `[friend]`

## Member Data Documentation

bool qx::QxSqlQuery::m_bDistinct`[protected]`

Replace SELECT by SELECT DISTINCT in SQL query.

Definition at line 268 of file QxSqlQuery.h.

int qx::QxSqlQuery::m_iParenthesisCount`[protected]`

Current parenthesis count.

Definition at line 267 of file QxSqlQuery.h.

int qx::QxSqlQuery::m_iSqlElementIndex`[protected]`

Current index of SQL element.

Definition at line 266 of file QxSqlQuery.h.

QList<qx::dao::detail::IxSqlElement_ptr> qx::QxSqlQuery::m_lstSqlElement`[protected]`

List of all SQL elements to build SQL query.

Definition at line 265 of file QxSqlQuery.h.

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

Bind value in this array.

Definition at line 263 of file QxSqlQuery.h.

qx::dao::detail::IxSqlElement_ptr qx::QxSqlQuery::m_pSqlElementTemp`[protected]`

Temporary SQL element.

Definition at line 264 of file QxSqlQuery.h.

std::shared_ptr<QxSqlResult> qx::QxSqlQuery::m_pSqlResult`[protected]`

All results returning by SQL query or stored procedure (after calling qx::dao::call_query function)

Definition at line 269 of file QxSqlQuery.h.

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

Query SQL with place-holder.

Definition at line 262 of file QxSqlQuery.h.

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

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