| QxOrm 1.2.9 C++ Object Relational Mapping library

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

- File List
- File Members

QxSqlQuery.h
Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** http://www.qxorm.com/
    00004 ** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
    00005 **
    00006 ** This file is part of the QxOrm library
    00007 **
    00008 ** This software is provided 'as-is', without any express or implied
    00009 ** warranty. In no event will the authors be held liable for any
    00010 ** damages arising from the use of this software
    00011 **
    00012 ** Commercial Usage
    00013 ** Licensees holding valid commercial QxOrm licenses may use this file in
    00014 ** accordance with the commercial license agreement provided with the
    00015 ** Software or, alternatively, in accordance with the terms contained in
    00016 ** a written agreement between you and Lionel Marty
    00017 **
    00018 ** GNU General Public License Usage
    00019 ** Alternatively, this file may be used under the terms of the GNU
    00020 ** General Public License version 3.0 as published by the Free Software
    00021 ** Foundation and appearing in the file 'license.gpl3.txt' included in the
    00022 ** packaging of this file. Please review the following information to
    00023 ** ensure the GNU General Public License version 3.0 requirements will be
    00024 ** met : http://www.gnu.org/copyleft/gpl.html
    00025 **
    00026 ** If you are unsure which license is appropriate for your use, or
    00027 ** if you have questions regarding the use of this file, please contact :
    00028 ** contact@qxorm.com
    00029 **
    00030 ****************************************************************************/
    00031
    00032 #ifndef _QX_SQL_QUERY_H_
    00033 #define _QX_SQL_QUERY_H_
    00034
    00035 #ifdef _MSC_VER
    00036 #pragma once
    00037 #endif
    00038
    00046 #include <boost/tuple/tuple.hpp>
    00047 #include <boost/tuple/tuple_comparison.hpp>
    00048 #include <boost/tuple/tuple_io.hpp>
    00049
    00050 #include <boost/serialization/serialization.hpp>
    00051 #include <boost/serialization/nvp.hpp>
    00052
    00053 #include <QtSql/qsqlquery.h>
    00054
    00055 #include <QxCollection/QxCollection.h>
    00056
    00057 #include <QxDao/QxSqlElement/QxSqlElement.h>
    00058
    00059 #include <QxSerialize/boost/QxSerialize_tuple.h>
    00060
    00061 #include <QxSerialize/Qt/QxSerialize_QString.h>
    00062 #include <QxSerialize/Qt/QxSerialize_QVariant.h>
    00063 #include <QxSerialize/Qt/QxSerialize_QHash.h>
    00064 #include <QxSerialize/Qt/QxSerialize_QVector.h>
    00065 #include <QxSerialize/Qt/QxSerialize_QFlags.h>
    00066
    00067 #include <QxSerialize/Qx/QxSerialize_QxCollection.h>
    00068
    00069 #include <QxTraits/get_class_name.h>
    00070
    00071 namespace qx {
    00072
    00205 class QX_DLL_EXPORT QxSqlQuery
    00206 {
    00207
    00208    friend class boost::serialization::access;
    00209
    00210 protected:
    00211
    00212    struct QxSqlResult
    00213    { QHash<QString, int> positionByKey; QVector< QVector<QVariant> > values; };
    00214
    00215    typedef boost::tuple<QVariant, QSql::ParamType> type_bind_value;
    00216
    00217    QString                                   m_sQuery;
    00218    QxCollection<QString, type_bind_value>    m_lstValue;
    00219    qx::dao::detail::IxSqlElement_ptr         m_pSqlElementTemp;
    00220    QList<qx::dao::detail::IxSqlElement_ptr>  m_lstSqlElement;
    00221    int                                       m_iSqlElementIndex;
    00222    int                                       m_iParenthesisCount;
    00223    bool                                      m_bDistinct;
    00224    boost::shared_ptr<QxSqlResult>            m_pSqlResult;
    00225
    00226 public:
    00227
    00228    QxSqlQuery() : m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00229    QxSqlQuery(const QString & sQuery) : m_sQuery(sQuery), m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00230    QxSqlQuery(const char * sQuery) : m_sQuery(sQuery), m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00231    virtual ~QxSqlQuery() { ; }
    00232
    00233    QString query();
    00234    bool isEmpty() const;
    00235    bool isDistinct() const;
    00236    void clear();
    00237    void resolve(QSqlQuery & query) const;
    00238    void resolveOutput(QSqlQuery & query, bool bFetchSqlResult);
    00239    void postProcess(QString & sql) const;
    00240
    00241    QxSqlQuery & query(const QString & sQuery);
    00242    QxSqlQuery & bind(const QVariant & vValue, QSql::ParamType paramType = QSql::In);
    00243    QxSqlQuery & bind(const QString & sKey, const QVariant & vValue, QSql::ParamType paramType = QSql::In);
    00244
    00245    QVariant boundValue(const QString & sKey) const;
    00246    QVariant boundValue(int iPosition) const;
    00247
    00248    long getSqlResultRowCount() const;
    00249    long getSqlResultColumnCount() const;
    00250    QVariant getSqlResultAt(long row, long column) const;
    00251    QVariant getSqlResultAt(long row, const QString & column) const;
    00252    QVector<QVariant> getSqlResultAt(long row) const;
    00253    QVector<QString> getSqlResultAllColumns() const;
    00254    void dumpSqlResult();
    00255
    00256 private:
    00257
    00258 #ifndef _QX_MODE_RELEASE
    00259    void verifyQuery() const;
    00260 #else // _QX_MODE_RELEASE
    00261    inline void verifyQuery() const { ; }
    00262 #endif // _QX_MODE_RELEASE
    00263
    00264    void fetchSqlResult(QSqlQuery & query);
    00265
    00266 public:
    00267
    00268    /* -- All methods to build SQL query using C++ syntax -- */
    00269
    00270    virtual QxSqlQuery & distinct();
    00271
    00272    virtual QxSqlQuery & where(const QString & column);
    00273    virtual QxSqlQuery & where_OpenParenthesis(const QString & column);
    00274    virtual QxSqlQuery & and_(const QString & column);
    00275    virtual QxSqlQuery & and_OpenParenthesis(const QString & column);
    00276    virtual QxSqlQuery & or_(const QString & column);
    00277    virtual QxSqlQuery & or_OpenParenthesis(const QString & column);
    00278
    00279    virtual QxSqlQuery & openParenthesis();
    00280    virtual QxSqlQuery & closeParenthesis();
    00281
    00282    virtual QxSqlQuery & orderAsc(const QStringList & columns);
    00283    virtual QxSqlQuery & orderAsc(const QString & col1);
    00284    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2);
    00285    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3);
    00286    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00287    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00288    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00289    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00290    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);
    00291    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);
    00292
    00293    virtual QxSqlQuery & orderDesc(const QStringList & columns);
    00294    virtual QxSqlQuery & orderDesc(const QString & col1);
    00295    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2);
    00296    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3);
    00297    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00298    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00299    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00300    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00301    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);
    00302    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);
    00303
    00304    virtual QxSqlQuery & groupBy(const QStringList & columns);
    00305    virtual QxSqlQuery & groupBy(const QString & col1);
    00306    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2);
    00307    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3);
    00308    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00309    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00310    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00311    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00312    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);
    00313    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);
    00314
    00315    virtual QxSqlQuery & limit(int rowsCount, int startRow = 0);
    00316
    00317    virtual QxSqlQuery & like(const QString & val);
    00318    virtual QxSqlQuery & notLike(const QString & val);
    00319    virtual QxSqlQuery & startsWith(const QString & val);
    00320    virtual QxSqlQuery & endsWith(const QString & val);
    00321    virtual QxSqlQuery & containsString(const QString & val);
    00322
    00323    virtual QxSqlQuery & isEqualTo(const QVariant & val);
    00324    virtual QxSqlQuery & isNotEqualTo(const QVariant & val);
    00325    virtual QxSqlQuery & isGreaterThan(const QVariant & val);
    00326    virtual QxSqlQuery & isGreaterThanOrEqualTo(const QVariant & val);
    00327    virtual QxSqlQuery & isLessThan(const QVariant & val);
    00328    virtual QxSqlQuery & isLessThanOrEqualTo(const QVariant & val);
    00329
    00330    virtual QxSqlQuery & in(const QVariantList & values);
    00331    virtual QxSqlQuery & in(const QVariant & val1);
    00332    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2);
    00333    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3);
    00334    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4);
    00335    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5);
    00336    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6);
    00337    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7);
    00338    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);
    00339    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);
    00340
    00341    virtual QxSqlQuery & notIn(const QVariantList & values);
    00342    virtual QxSqlQuery & notIn(const QVariant & val1);
    00343    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2);
    00344    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3);
    00345    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4);
    00346    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5);
    00347    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6);
    00348    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7);
    00349    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);
    00350    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);
    00351
    00352    virtual QxSqlQuery & in_Select(const QString & sql);
    00353    virtual QxSqlQuery & notIn_Select(const QString & sql);
    00354
    00355    virtual QxSqlQuery & isNull();
    00356    virtual QxSqlQuery & isNotNull();
    00357
    00358    virtual QxSqlQuery & isBetween(const QVariant & val1, const QVariant & val2);
    00359    virtual QxSqlQuery & isNotBetween(const QVariant & val1, const QVariant & val2);
    00360
    00361    virtual QxSqlQuery & freeText(const QString & text);
    00362
    00363 private:
    00364
    00365    QxSqlQuery & addSqlExpression(const QString & column, qx::dao::detail::QxSqlExpression::type type);
    00366    QxSqlQuery & addSqlCompare(const QVariant & val, qx::dao::detail::QxSqlCompare::type type);
    00367    QxSqlQuery & addSqlSort(const QStringList & columns, qx::dao::detail::QxSqlSort::type type);
    00368    QxSqlQuery & addSqlIn(const QVariantList & values, qx::dao::detail::QxSqlIn::type type);
    00369    QxSqlQuery & addSqlIsNull(qx::dao::detail::QxSqlIsNull::type type);
    00370    QxSqlQuery & addSqlIsBetween(const QVariant & val1, const QVariant & val2, qx::dao::detail::QxSqlIsBetween::type type);
    00371
    00372    template <class Archive>
    00373    void serialize(Archive & ar, const unsigned int file_version)
    00374    {
    00375       Q_UNUSED(file_version);
    00376       QString sQuery; QHash<QString, int> lstResultPosByKey;
    00377       QVector< QVector<QVariant> > lstResultValues;
    00378
    00379       if (Archive::is_saving::value)
    00380       {
    00381          sQuery = this->query();
    00382          if (m_pSqlResult) { lstResultPosByKey = m_pSqlResult->positionByKey; }
    00383          if (m_pSqlResult) { lstResultValues = m_pSqlResult->values; }
    00384       }
    00385
    00386       ar & boost::serialization::make_nvp("query", sQuery);
    00387       ar & boost::serialization::make_nvp("distinct", m_bDistinct);
    00388       ar & boost::serialization::make_nvp("list_values", m_lstValue);
    00389       ar & boost::serialization::make_nvp("result_position_by_key", lstResultPosByKey);
    00390       ar & boost::serialization::make_nvp("result_values", lstResultValues);
    00391
    00392       if (Archive::is_loading::value)
    00393       {
    00394          m_lstSqlElement.clear();
    00395          m_sQuery = sQuery;
    00396          m_pSqlResult.reset();
    00397          if ((lstResultPosByKey.count() > 0) || (lstResultValues.count() > 0))
    00398          {
    00399             m_pSqlResult = boost::shared_ptr<QxSqlResult>(new QxSqlResult());
    00400             m_pSqlResult->positionByKey = lstResultPosByKey;
    00401             m_pSqlResult->values = lstResultValues;
    00402          }
    00403       }
    00404    }
    00405
    00406 };
    00407
    00408 } // namespace qx
    00409
    00410 typedef qx::QxSqlQuery qx_query;
    00411
    00412 namespace qx {
    00413 namespace dao {
    00414
    00438 QX_DLL_EXPORT QSqlError call_query(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL);
    00439
    00440 } // namespace dao
    00441 } // namespace qx
    00442
    00443 QX_REGISTER_CLASS_NAME(qx_query)
    00444
    00445 #define QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_HPP(className) \
    00446 public: \
    00447 \
    00448 virtual className & distinct(); \
    00449 \
    00450 virtual className & where(const QString & column); \
    00451 virtual className & where_OpenParenthesis(const QString & column); \
    00452 virtual className & and_(const QString & column); \
    00453 virtual className & and_OpenParenthesis(const QString & column); \
    00454 virtual className & or_(const QString & column); \
    00455 virtual className & or_OpenParenthesis(const QString & column); \
    00456 \
    00457 virtual className & openParenthesis(); \
    00458 virtual className & closeParenthesis(); \
    00459 \
    00460 virtual className & orderAsc(const QStringList & columns); \
    00461 virtual className & orderAsc(const QString & col1); \
    00462 virtual className & orderAsc(const QString & col1, const QString & col2); \
    00463 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3); \
    00464 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00465 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00466 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00467 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00468 virtual className & 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); \
    00469 virtual className & 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); \
    00470 \
    00471 virtual className & orderDesc(const QStringList & columns); \
    00472 virtual className & orderDesc(const QString & col1); \
    00473 virtual className & orderDesc(const QString & col1, const QString & col2); \
    00474 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3); \
    00475 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00476 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00477 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00478 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00479 virtual className & 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); \
    00480 virtual className & 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); \
    00481 \
    00482 virtual className & groupBy(const QStringList & columns); \
    00483 virtual className & groupBy(const QString & col1); \
    00484 virtual className & groupBy(const QString & col1, const QString & col2); \
    00485 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3); \
    00486 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00487 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00488 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00489 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00490 virtual className & 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); \
    00491 virtual className & 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); \
    00492 \
    00493 virtual className & limit(int rowsCount, int startRow = 0); \
    00494 \
    00495 virtual className & like(const QString & val); \
    00496 virtual className & notLike(const QString & val); \
    00497 virtual className & startsWith(const QString & val); \
    00498 virtual className & endsWith(const QString & val); \
    00499 virtual className & containsString(const QString & val); \
    00500 \
    00501 virtual className & isEqualTo(const QVariant & val); \
    00502 virtual className & isNotEqualTo(const QVariant & val); \
    00503 virtual className & isGreaterThan(const QVariant & val); \
    00504 virtual className & isGreaterThanOrEqualTo(const QVariant & val); \
    00505 virtual className & isLessThan(const QVariant & val); \
    00506 virtual className & isLessThanOrEqualTo(const QVariant & val); \
    00507 \
    00508 virtual className & in(const QVariantList & values); \
    00509 virtual className & in(const QVariant & val1); \
    00510 virtual className & in(const QVariant & val1, const QVariant & val2); \
    00511 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3); \
    00512 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4); \
    00513 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5); \
    00514 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6); \
    00515 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7); \
    00516 virtual className & 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); \
    00517 virtual className & 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); \
    00518 \
    00519 virtual className & notIn(const QVariantList & values); \
    00520 virtual className & notIn(const QVariant & val1); \
    00521 virtual className & notIn(const QVariant & val1, const QVariant & val2); \
    00522 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3); \
    00523 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4); \
    00524 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5); \
    00525 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6); \
    00526 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7); \
    00527 virtual className & 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); \
    00528 virtual className & 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); \
    00529 \
    00530 virtual className & in_Select(const QString & sql); \
    00531 virtual className & notIn_Select(const QString & sql); \
    00532 \
    00533 virtual className & isNull(); \
    00534 virtual className & isNotNull(); \
    00535 \
    00536 virtual className & isBetween(const QVariant & val1, const QVariant & val2); \
    00537 virtual className & isNotBetween(const QVariant & val1, const QVariant & val2); \
    00538 \
    00539 virtual className & freeText(const QString & text);
    00540
    00541 #define QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_CPP(className) \
    00542 \
    00543 className & className::distinct() { return static_cast<className &>(qx::QxSqlQuery::distinct()); } \
    00544 \
    00545 className & className::where(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::where(column)); } \
    00546 className & className::where_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::where_OpenParenthesis(column)); } \
    00547 className & className::and_(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::and_(column)); } \
    00548 className & className::and_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::and_OpenParenthesis(column)); } \
    00549 className & className::or_(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::or_(column)); } \
    00550 className & className::or_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::or_OpenParenthesis(column)); } \
    00551 \
    00552 className & className::openParenthesis() { return static_cast<className &>(qx::QxSqlQuery::openParenthesis()); } \
    00553 className & className::closeParenthesis() { return static_cast<className &>(qx::QxSqlQuery::closeParenthesis()); } \
    00554 \
    00555 className & className::orderAsc(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(columns)); } \
    00556 className & className::orderAsc(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1)); } \
    00557 className & className::orderAsc(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2)); } \
    00558 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3)); } \
    00559 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3, col4)); } \
    00560 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3, col4, col5)); } \
    00561 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3, col4, col5, col6)); } \
    00562 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3, col4, col5, col6, col7)); } \
    00563 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3, col4, col5, col6, col7, col8)); } \
    00564 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3, col4, col5, col6, col7, col8, col9)); } \
    00565 \
    00566 className & className::orderDesc(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(columns)); } \
    00567 className & className::orderDesc(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1)); } \
    00568 className & className::orderDesc(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2)); } \
    00569 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3)); } \
    00570 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3, col4)); } \
    00571 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3, col4, col5)); } \
    00572 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3, col4, col5, col6)); } \
    00573 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3, col4, col5, col6, col7)); } \
    00574 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3, col4, col5, col6, col7, col8)); } \
    00575 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3, col4, col5, col6, col7, col8, col9)); } \
    00576 \
    00577 className & className::groupBy(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::groupBy(columns)); } \
    00578 className & className::groupBy(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1)); } \
    00579 className & className::groupBy(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2)); } \
    00580 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3)); } \
    00581 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3, col4)); } \
    00582 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3, col4, col5)); } \
    00583 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3, col4, col5, col6)); } \
    00584 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3, col4, col5, col6, col7)); } \
    00585 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3, col4, col5, col6, col7, col8)); } \
    00586 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3, col4, col5, col6, col7, col8, col9)); } \
    00587 \
    00588 className & className::limit(int rowsCount, int startRow) { return static_cast<className &>(qx::QxSqlQuery::limit(rowsCount, startRow)); } \
    00589 \
    00590 className & className::like(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::like(val)); } \
    00591 className & className::notLike(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::notLike(val)); } \
    00592 className & className::startsWith(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::startsWith(val)); } \
    00593 className & className::endsWith(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::endsWith(val)); } \
    00594 className & className::containsString(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::containsString(val)); } \
    00595 \
    00596 className & className::isEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isEqualTo(val)); } \
    00597 className & className::isNotEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isNotEqualTo(val)); } \
    00598 className & className::isGreaterThan(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isGreaterThan(val)); } \
    00599 className & className::isGreaterThanOrEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isGreaterThanOrEqualTo(val)); } \
    00600 className & className::isLessThan(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isLessThan(val)); } \
    00601 className & className::isLessThanOrEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isLessThanOrEqualTo(val)); } \
    00602 \
    00603 className & className::in(const QVariantList & values) { return static_cast<className &>(qx::QxSqlQuery::in(values)); } \
    00604 className & className::in(const QVariant & val1) { return static_cast<className &>(qx::QxSqlQuery::in(val1)); } \
    00605 className & className::in(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2)); } \
    00606 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3)); } \
    00607 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3, val4)); } \
    00608 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3, val4, val5)); } \
    00609 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3, val4, val5, val6)); } \
    00610 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3, val4, val5, val6, val7)); } \
    00611 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3, val4, val5, val6, val7, val8)); } \
    00612 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3, val4, val5, val6, val7, val8, val9)); } \
    00613 \
    00614 className & className::notIn(const QVariantList & values) { return static_cast<className &>(qx::QxSqlQuery::notIn(values)); } \
    00615 className & className::notIn(const QVariant & val1) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1)); } \
    00616 className & className::notIn(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2)); } \
    00617 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3)); } \
    00618 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3, val4)); } \
    00619 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3, val4, val5)); } \
    00620 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3, val4, val5, val6)); } \
    00621 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3, val4, val5, val6, val7)); } \
    00622 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3, val4, val5, val6, val7, val8)); } \
    00623 className & className::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) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3, val4, val5, val6, val7, val8, val9)); } \
    00624 \
    00625 className & className::in_Select(const QString & sql) { return static_cast<className &>(qx::QxSqlQuery::in_Select(sql)); } \
    00626 className & className::notIn_Select(const QString & sql) { return static_cast<className &>(qx::QxSqlQuery::notIn_Select(sql)); } \
    00627 \
    00628 className & className::isNull() { return static_cast<className &>(qx::QxSqlQuery::isNull()); } \
    00629 className & className::isNotNull() { return static_cast<className &>(qx::QxSqlQuery::isNotNull()); } \
    00630 \
    00631 className & className::isBetween(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::isBetween(val1, val2)); } \
    00632 className & className::isNotBetween(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::isNotBetween(val1, val2)); } \
    00633 \
    00634 className & className::freeText(const QString & text) { return static_cast<className &>(qx::QxSqlQuery::freeText(text)); }
    00635
    00636 #endif // _QX_SQL_QUERY_H_