| QxOrm 1.3.1 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/split_free.hpp>
    00052 #include <boost/serialization/version.hpp>
    00053 #include <boost/serialization/nvp.hpp>
    00054
    00055 #include <QtSql/qsqlquery.h>
    00056
    00057 #include <QxCollection/QxCollection.h>
    00058
    00059 #include <QxDao/QxSqlElement/QxSqlElement.h>
    00060
    00061 #include <QxSerialize/QxSerializeFastCompil.h>
    00062
    00063 #include <QxTraits/get_class_name.h>
    00064
    00065 namespace qx {
    00066
    00067 class QxSqlQuery;
    00068
    00069 } // namespace qx
    00070
    00071 namespace boost {
    00072 namespace serialization {
    00073
    00074 template <class Archive> inline void qx_save(Archive & ar, const qx::QxSqlQuery & t, const unsigned int file_version);
    00075 template <class Archive> inline void qx_load(Archive & ar, qx::QxSqlQuery & t, const unsigned int file_version);
    00076
    00077 } // namespace serialization
    00078 } // namespace boost
    00079
    00080 namespace qx {
    00081
    00214 class QX_DLL_EXPORT QxSqlQuery
    00215 {
    00216
    00217    template <class Archive> friend inline void boost::serialization::qx_save(Archive & ar, const qx::QxSqlQuery & t, const unsigned int file_version);
    00218    template <class Archive> friend inline void boost::serialization::qx_load(Archive & ar, qx::QxSqlQuery & t, const unsigned int file_version);
    00219
    00220 protected:
    00221
    00222    struct QxSqlResult
    00223    { QHash<QString, int> positionByKey; QVector< QVector<QVariant> > values; };
    00224
    00225    typedef boost::tuple<QVariant, QSql::ParamType> type_bind_value;
    00226
    00227    QString                                   m_sQuery;
    00228    QxCollection<QString, type_bind_value>    m_lstValue;
    00229    qx::dao::detail::IxSqlElement_ptr         m_pSqlElementTemp;
    00230    QList<qx::dao::detail::IxSqlElement_ptr>  m_lstSqlElement;
    00231    int                                       m_iSqlElementIndex;
    00232    int                                       m_iParenthesisCount;
    00233    bool                                      m_bDistinct;
    00234    boost::shared_ptr<QxSqlResult>            m_pSqlResult;
    00235
    00236 public:
    00237
    00238    QxSqlQuery() : m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00239    QxSqlQuery(const QString & sQuery) : m_sQuery(sQuery), m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00240    QxSqlQuery(const char * sQuery) : m_sQuery(sQuery), m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00241    virtual ~QxSqlQuery() { ; }
    00242
    00243    QString query();
    00244    bool isEmpty() const;
    00245    bool isDistinct() const;
    00246    void clear();
    00247    void resolve(QSqlQuery & query) const;
    00248    void resolveOutput(QSqlQuery & query, bool bFetchSqlResult);
    00249    void postProcess(QString & sql) const;
    00250
    00251    QxSqlQuery & query(const QString & sQuery);
    00252    QxSqlQuery & bind(const QVariant & vValue, QSql::ParamType paramType = QSql::In);
    00253    QxSqlQuery & bind(const QString & sKey, const QVariant & vValue, QSql::ParamType paramType = QSql::In);
    00254
    00255    QVariant boundValue(const QString & sKey) const;
    00256    QVariant boundValue(int iPosition) const;
    00257
    00258    long getSqlResultRowCount() const;
    00259    long getSqlResultColumnCount() const;
    00260    QVariant getSqlResultAt(long row, long column) const;
    00261    QVariant getSqlResultAt(long row, const QString & column) const;
    00262    QVector<QVariant> getSqlResultAt(long row) const;
    00263    QVector<QString> getSqlResultAllColumns() const;
    00264    void dumpSqlResult();
    00265
    00266 private:
    00267
    00268 #ifndef _QX_MODE_RELEASE
    00269    void verifyQuery() const;
    00270 #else // _QX_MODE_RELEASE
    00271    inline void verifyQuery() const { ; }
    00272 #endif // _QX_MODE_RELEASE
    00273
    00274    void fetchSqlResult(QSqlQuery & query);
    00275
    00276 public:
    00277
    00278    /* -- All methods to build SQL query using C++ syntax -- */
    00279
    00280    virtual QxSqlQuery & distinct();
    00281
    00282    virtual QxSqlQuery & where(const QString & column);
    00283    virtual QxSqlQuery & where_OpenParenthesis(const QString & column);
    00284    virtual QxSqlQuery & and_(const QString & column);
    00285    virtual QxSqlQuery & and_OpenParenthesis(const QString & column);
    00286    virtual QxSqlQuery & or_(const QString & column);
    00287    virtual QxSqlQuery & or_OpenParenthesis(const QString & column);
    00288
    00289    virtual QxSqlQuery & openParenthesis();
    00290    virtual QxSqlQuery & closeParenthesis();
    00291
    00292    virtual QxSqlQuery & orderAsc(const QStringList & columns);
    00293    virtual QxSqlQuery & orderAsc(const QString & col1);
    00294    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2);
    00295    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3);
    00296    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00297    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00298    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00299    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00300    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);
    00301    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);
    00302
    00303    virtual QxSqlQuery & orderDesc(const QStringList & columns);
    00304    virtual QxSqlQuery & orderDesc(const QString & col1);
    00305    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2);
    00306    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3);
    00307    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00308    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00309    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00310    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00311    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);
    00312    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);
    00313
    00314    virtual QxSqlQuery & groupBy(const QStringList & columns);
    00315    virtual QxSqlQuery & groupBy(const QString & col1);
    00316    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2);
    00317    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3);
    00318    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00319    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00320    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00321    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00322    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);
    00323    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);
    00324
    00325    virtual QxSqlQuery & limit(int rowsCount, int startRow = 0);
    00326
    00327    virtual QxSqlQuery & like(const QString & val);
    00328    virtual QxSqlQuery & notLike(const QString & val);
    00329    virtual QxSqlQuery & startsWith(const QString & val);
    00330    virtual QxSqlQuery & endsWith(const QString & val);
    00331    virtual QxSqlQuery & containsString(const QString & val);
    00332
    00333    virtual QxSqlQuery & isEqualTo(const QVariant & val);
    00334    virtual QxSqlQuery & isNotEqualTo(const QVariant & val);
    00335    virtual QxSqlQuery & isGreaterThan(const QVariant & val);
    00336    virtual QxSqlQuery & isGreaterThanOrEqualTo(const QVariant & val);
    00337    virtual QxSqlQuery & isLessThan(const QVariant & val);
    00338    virtual QxSqlQuery & isLessThanOrEqualTo(const QVariant & val);
    00339
    00340    virtual QxSqlQuery & in(const QVariantList & values);
    00341    virtual QxSqlQuery & in(const QVariant & val1);
    00342    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2);
    00343    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3);
    00344    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4);
    00345    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5);
    00346    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6);
    00347    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7);
    00348    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);
    00349    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);
    00350
    00351    virtual QxSqlQuery & notIn(const QVariantList & values);
    00352    virtual QxSqlQuery & notIn(const QVariant & val1);
    00353    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2);
    00354    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3);
    00355    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4);
    00356    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5);
    00357    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6);
    00358    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7);
    00359    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);
    00360    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);
    00361
    00362    virtual QxSqlQuery & in_Select(const QString & sql);
    00363    virtual QxSqlQuery & notIn_Select(const QString & sql);
    00364
    00365    virtual QxSqlQuery & isNull();
    00366    virtual QxSqlQuery & isNotNull();
    00367
    00368    virtual QxSqlQuery & isBetween(const QVariant & val1, const QVariant & val2);
    00369    virtual QxSqlQuery & isNotBetween(const QVariant & val1, const QVariant & val2);
    00370
    00371    virtual QxSqlQuery & freeText(const QString & text);
    00372
    00373 private:
    00374
    00375    QxSqlQuery & addSqlExpression(const QString & column, qx::dao::detail::QxSqlExpression::type type);
    00376    QxSqlQuery & addSqlCompare(const QVariant & val, qx::dao::detail::QxSqlCompare::type type);
    00377    QxSqlQuery & addSqlSort(const QStringList & columns, qx::dao::detail::QxSqlSort::type type);
    00378    QxSqlQuery & addSqlIn(const QVariantList & values, qx::dao::detail::QxSqlIn::type type);
    00379    QxSqlQuery & addSqlIsNull(qx::dao::detail::QxSqlIsNull::type type);
    00380    QxSqlQuery & addSqlIsBetween(const QVariant & val1, const QVariant & val2, qx::dao::detail::QxSqlIsBetween::type type);
    00381
    00382 };
    00383
    00384 } // namespace qx
    00385
    00386 typedef qx::QxSqlQuery qx_query;
    00387
    00388 namespace qx {
    00389 namespace dao {
    00390
    00414 QX_DLL_EXPORT QSqlError call_query(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL);
    00415
    00416 } // namespace dao
    00417 } // namespace qx
    00418
    00419 QX_REGISTER_CLASS_NAME(qx_query)
    00420
    00421 BOOST_CLASS_VERSION(qx::QxSqlQuery, 0)
    00422
    00423 QX_SERIALIZE_FAST_COMPIL_SAVE_LOAD_HPP(QX_DLL_EXPORT, qx::QxSqlQuery)
    00424
    00425 #define QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_HPP(className) \
    00426 public: \
    00427 \
    00428 virtual className & distinct(); \
    00429 \
    00430 virtual className & where(const QString & column); \
    00431 virtual className & where_OpenParenthesis(const QString & column); \
    00432 virtual className & and_(const QString & column); \
    00433 virtual className & and_OpenParenthesis(const QString & column); \
    00434 virtual className & or_(const QString & column); \
    00435 virtual className & or_OpenParenthesis(const QString & column); \
    00436 \
    00437 virtual className & openParenthesis(); \
    00438 virtual className & closeParenthesis(); \
    00439 \
    00440 virtual className & orderAsc(const QStringList & columns); \
    00441 virtual className & orderAsc(const QString & col1); \
    00442 virtual className & orderAsc(const QString & col1, const QString & col2); \
    00443 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3); \
    00444 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00445 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00446 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00447 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00448 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); \
    00449 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); \
    00450 \
    00451 virtual className & orderDesc(const QStringList & columns); \
    00452 virtual className & orderDesc(const QString & col1); \
    00453 virtual className & orderDesc(const QString & col1, const QString & col2); \
    00454 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3); \
    00455 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00456 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00457 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00458 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00459 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); \
    00460 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); \
    00461 \
    00462 virtual className & groupBy(const QStringList & columns); \
    00463 virtual className & groupBy(const QString & col1); \
    00464 virtual className & groupBy(const QString & col1, const QString & col2); \
    00465 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3); \
    00466 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00467 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00468 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00469 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00470 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); \
    00471 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); \
    00472 \
    00473 virtual className & limit(int rowsCount, int startRow = 0); \
    00474 \
    00475 virtual className & like(const QString & val); \
    00476 virtual className & notLike(const QString & val); \
    00477 virtual className & startsWith(const QString & val); \
    00478 virtual className & endsWith(const QString & val); \
    00479 virtual className & containsString(const QString & val); \
    00480 \
    00481 virtual className & isEqualTo(const QVariant & val); \
    00482 virtual className & isNotEqualTo(const QVariant & val); \
    00483 virtual className & isGreaterThan(const QVariant & val); \
    00484 virtual className & isGreaterThanOrEqualTo(const QVariant & val); \
    00485 virtual className & isLessThan(const QVariant & val); \
    00486 virtual className & isLessThanOrEqualTo(const QVariant & val); \
    00487 \
    00488 virtual className & in(const QVariantList & values); \
    00489 virtual className & in(const QVariant & val1); \
    00490 virtual className & in(const QVariant & val1, const QVariant & val2); \
    00491 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3); \
    00492 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4); \
    00493 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5); \
    00494 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6); \
    00495 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7); \
    00496 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); \
    00497 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); \
    00498 \
    00499 virtual className & notIn(const QVariantList & values); \
    00500 virtual className & notIn(const QVariant & val1); \
    00501 virtual className & notIn(const QVariant & val1, const QVariant & val2); \
    00502 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3); \
    00503 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4); \
    00504 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5); \
    00505 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6); \
    00506 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7); \
    00507 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); \
    00508 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); \
    00509 \
    00510 virtual className & in_Select(const QString & sql); \
    00511 virtual className & notIn_Select(const QString & sql); \
    00512 \
    00513 virtual className & isNull(); \
    00514 virtual className & isNotNull(); \
    00515 \
    00516 virtual className & isBetween(const QVariant & val1, const QVariant & val2); \
    00517 virtual className & isNotBetween(const QVariant & val1, const QVariant & val2); \
    00518 \
    00519 virtual className & freeText(const QString & text);
    00520
    00521 #define QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_CPP(className) \
    00522 \
    00523 className & className::distinct() { return static_cast<className &>(qx::QxSqlQuery::distinct()); } \
    00524 \
    00525 className & className::where(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::where(column)); } \
    00526 className & className::where_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::where_OpenParenthesis(column)); } \
    00527 className & className::and_(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::and_(column)); } \
    00528 className & className::and_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::and_OpenParenthesis(column)); } \
    00529 className & className::or_(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::or_(column)); } \
    00530 className & className::or_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::or_OpenParenthesis(column)); } \
    00531 \
    00532 className & className::openParenthesis() { return static_cast<className &>(qx::QxSqlQuery::openParenthesis()); } \
    00533 className & className::closeParenthesis() { return static_cast<className &>(qx::QxSqlQuery::closeParenthesis()); } \
    00534 \
    00535 className & className::orderAsc(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(columns)); } \
    00536 className & className::orderAsc(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1)); } \
    00537 className & className::orderAsc(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2)); } \
    00538 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3)); } \
    00539 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)); } \
    00540 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)); } \
    00541 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)); } \
    00542 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)); } \
    00543 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)); } \
    00544 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)); } \
    00545 \
    00546 className & className::orderDesc(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(columns)); } \
    00547 className & className::orderDesc(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1)); } \
    00548 className & className::orderDesc(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2)); } \
    00549 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3)); } \
    00550 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)); } \
    00551 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)); } \
    00552 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)); } \
    00553 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)); } \
    00554 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)); } \
    00555 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)); } \
    00556 \
    00557 className & className::groupBy(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::groupBy(columns)); } \
    00558 className & className::groupBy(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1)); } \
    00559 className & className::groupBy(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2)); } \
    00560 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3)); } \
    00561 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)); } \
    00562 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)); } \
    00563 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)); } \
    00564 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)); } \
    00565 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)); } \
    00566 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)); } \
    00567 \
    00568 className & className::limit(int rowsCount, int startRow) { return static_cast<className &>(qx::QxSqlQuery::limit(rowsCount, startRow)); } \
    00569 \
    00570 className & className::like(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::like(val)); } \
    00571 className & className::notLike(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::notLike(val)); } \
    00572 className & className::startsWith(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::startsWith(val)); } \
    00573 className & className::endsWith(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::endsWith(val)); } \
    00574 className & className::containsString(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::containsString(val)); } \
    00575 \
    00576 className & className::isEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isEqualTo(val)); } \
    00577 className & className::isNotEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isNotEqualTo(val)); } \
    00578 className & className::isGreaterThan(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isGreaterThan(val)); } \
    00579 className & className::isGreaterThanOrEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isGreaterThanOrEqualTo(val)); } \
    00580 className & className::isLessThan(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isLessThan(val)); } \
    00581 className & className::isLessThanOrEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isLessThanOrEqualTo(val)); } \
    00582 \
    00583 className & className::in(const QVariantList & values) { return static_cast<className &>(qx::QxSqlQuery::in(values)); } \
    00584 className & className::in(const QVariant & val1) { return static_cast<className &>(qx::QxSqlQuery::in(val1)); } \
    00585 className & className::in(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2)); } \
    00586 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3)); } \
    00587 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)); } \
    00588 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)); } \
    00589 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)); } \
    00590 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)); } \
    00591 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)); } \
    00592 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)); } \
    00593 \
    00594 className & className::notIn(const QVariantList & values) { return static_cast<className &>(qx::QxSqlQuery::notIn(values)); } \
    00595 className & className::notIn(const QVariant & val1) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1)); } \
    00596 className & className::notIn(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2)); } \
    00597 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3)); } \
    00598 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)); } \
    00599 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)); } \
    00600 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)); } \
    00601 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)); } \
    00602 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)); } \
    00603 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)); } \
    00604 \
    00605 className & className::in_Select(const QString & sql) { return static_cast<className &>(qx::QxSqlQuery::in_Select(sql)); } \
    00606 className & className::notIn_Select(const QString & sql) { return static_cast<className &>(qx::QxSqlQuery::notIn_Select(sql)); } \
    00607 \
    00608 className & className::isNull() { return static_cast<className &>(qx::QxSqlQuery::isNull()); } \
    00609 className & className::isNotNull() { return static_cast<className &>(qx::QxSqlQuery::isNotNull()); } \
    00610 \
    00611 className & className::isBetween(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::isBetween(val1, val2)); } \
    00612 className & className::isNotBetween(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::isNotBetween(val1, val2)); } \
    00613 \
    00614 className & className::freeText(const QString & text) { return static_cast<className &>(qx::QxSqlQuery::freeText(text)); }
    00615
    00616 #endif // _QX_SQL_QUERY_H_