| QxOrm 1.4.4 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 #ifdef _QX_ENABLE_BOOST_SERIALIZATION
    00047 #include <boost/serialization/serialization.hpp>
    00048 #include <boost/serialization/split_free.hpp>
    00049 #include <boost/serialization/nvp.hpp>
    00050 #endif // _QX_ENABLE_BOOST_SERIALIZATION
    00051
    00052 #include <QtCore/qdatastream.h>
    00053
    00054 #ifndef _QX_NO_JSON
    00055 #include <QtCore/qjsonvalue.h>
    00056 #endif // _QX_NO_JSON
    00057
    00058 #include <QtSql/qsqlquery.h>
    00059
    00060 #include <QxCollection/QxCollection.h>
    00061
    00062 #include <QxDao/QxSqlElement/QxSqlElement.h>
    00063
    00064 #include <QxSerialize/QxSerializeFastCompil.h>
    00065
    00066 #include <QxTraits/get_class_name.h>
    00067
    00068 #include <QxRegister/QxVersion.h>
    00069
    00070 #include <QxConvert/QxConvert.h>
    00071
    00072 namespace qx {
    00073 class QxSqlQuery;
    00074 } // namespace qx
    00075
    00076 #ifdef _QX_ENABLE_BOOST_SERIALIZATION
    00077 namespace boost {
    00078 namespace serialization {
    00079
    00080 template <class Archive> inline void qx_save(Archive & ar, const qx::QxSqlQuery & t, const unsigned int file_version);
    00081 template <class Archive> inline void qx_load(Archive & ar, qx::QxSqlQuery & t, const unsigned int file_version);
    00082
    00083 } // namespace serialization
    00084 } // namespace boost
    00085 #endif // _QX_ENABLE_BOOST_SERIALIZATION
    00086
    00087 QX_DLL_EXPORT QDataStream & operator<< (QDataStream & stream, const qx::QxSqlQuery & t) QX_USED;
    00088 QX_DLL_EXPORT QDataStream & operator>> (QDataStream & stream, qx::QxSqlQuery & t) QX_USED;
    00089
    00090 #ifndef _QX_NO_JSON
    00091 namespace qx {
    00092 namespace cvt {
    00093 namespace detail {
    00094 template <> struct QxConvert_ToJson< qx::QxSqlQuery >;
    00095 template <> struct QxConvert_FromJson< qx::QxSqlQuery >;
    00096 QX_DLL_EXPORT QJsonValue QxConvert_ToJson_Helper(const qx::QxSqlQuery & t, const QString & format) QX_USED;
    00097 QX_DLL_EXPORT qx_bool QxConvert_FromJson_Helper(const QJsonValue & j, qx::QxSqlQuery & t, const QString & format) QX_USED;
    00098 } // namespace detail
    00099 } // namespace cvt
    00100 } // namespace qx
    00101 #endif // _QX_NO_JSON
    00102
    00103 namespace qx {
    00104
    00237 class QX_DLL_EXPORT QxSqlQuery
    00238 {
    00239
    00240 #ifdef _QX_ENABLE_BOOST_SERIALIZATION
    00241    template <class Archive> friend inline void boost::serialization::qx_save(Archive & ar, const qx::QxSqlQuery & t, const unsigned int file_version);
    00242    template <class Archive> friend inline void boost::serialization::qx_load(Archive & ar, qx::QxSqlQuery & t, const unsigned int file_version);
    00243 #endif // _QX_ENABLE_BOOST_SERIALIZATION
    00244
    00245    friend QDataStream & ::operator<< (QDataStream & stream, const qx::QxSqlQuery & t);
    00246    friend QDataStream & ::operator>> (QDataStream & stream, qx::QxSqlQuery & t);
    00247
    00248 #ifndef _QX_NO_JSON
    00249    friend struct qx::cvt::detail::QxConvert_ToJson< qx::QxSqlQuery >;
    00250    friend struct qx::cvt::detail::QxConvert_FromJson< qx::QxSqlQuery >;
    00251    friend QJsonValue qx::cvt::detail::QxConvert_ToJson_Helper(const qx::QxSqlQuery & t, const QString & format);
    00252    friend qx_bool qx::cvt::detail::QxConvert_FromJson_Helper(const QJsonValue & j, qx::QxSqlQuery & t, const QString & format);
    00253 #endif // _QX_NO_JSON
    00254
    00255 protected:
    00256
    00257    struct QxSqlResult
    00258    { QHash<QString, int> positionByKey; QVector< QVector<QVariant> > values; };
    00259
    00260    typedef std::tuple<QVariant, QSql::ParamType> type_bind_value;
    00261
    00262    QString                                   m_sQuery;
    00263    QxCollection<QString, type_bind_value>    m_lstValue;
    00264    qx::dao::detail::IxSqlElement_ptr         m_pSqlElementTemp;
    00265    QList<qx::dao::detail::IxSqlElement_ptr>  m_lstSqlElement;
    00266    int                                       m_iSqlElementIndex;
    00267    int                                       m_iParenthesisCount;
    00268    bool                                      m_bDistinct;
    00269    std::shared_ptr<QxSqlResult>              m_pSqlResult;
    00270
    00271 public:
    00272
    00273    QxSqlQuery() : m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00274    QxSqlQuery(const QString & sQuery) : m_sQuery(sQuery), m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00275    QxSqlQuery(const char * sQuery) : m_sQuery(sQuery), m_iSqlElementIndex(0), m_iParenthesisCount(0), m_bDistinct(false) { ; }
    00276    virtual ~QxSqlQuery() { ; }
    00277
    00278    QString query();
    00279    bool isEmpty() const;
    00280    bool isDistinct() const;
    00281    void clear();
    00282    void resolve(QSqlQuery & query) const;
    00283    void resolveOutput(QSqlQuery & query, bool bFetchSqlResult);
    00284    void postProcess(QString & sql) const;
    00285
    00286    QxSqlQuery & query(const QString & sQuery);
    00287    QxSqlQuery & bind(const QVariant & vValue, QSql::ParamType paramType = QSql::In);
    00288    QxSqlQuery & bind(const QString & sKey, const QVariant & vValue, QSql::ParamType paramType = QSql::In);
    00289
    00290    QVariant boundValue(const QString & sKey) const;
    00291    QVariant boundValue(int iPosition) const;
    00292
    00293    long getSqlResultRowCount() const;
    00294    long getSqlResultColumnCount() const;
    00295    QVariant getSqlResultAt(long row, long column) const;
    00296    QVariant getSqlResultAt(long row, const QString & column) const;
    00297    QVector<QVariant> getSqlResultAt(long row) const;
    00298    QVector<QString> getSqlResultAllColumns() const;
    00299    void dumpSqlResult();
    00300
    00301    static void dumpBoundValues(const QSqlQuery & query);
    00302
    00303 private:
    00304
    00305    void verifyQuery() const QX_USED;
    00306    void fetchSqlResult(QSqlQuery & query);
    00307
    00308 public:
    00309
    00310    /* -- All methods to build SQL query using C++ syntax -- */
    00311
    00312    virtual QxSqlQuery & distinct();
    00313
    00314    virtual QxSqlQuery & where(const QString & column);
    00315    virtual QxSqlQuery & where_OpenParenthesis(const QString & column);
    00316    virtual QxSqlQuery & and_(const QString & column);
    00317    virtual QxSqlQuery & and_OpenParenthesis(const QString & column);
    00318    virtual QxSqlQuery & or_(const QString & column);
    00319    virtual QxSqlQuery & or_OpenParenthesis(const QString & column);
    00320
    00321    virtual QxSqlQuery & openParenthesis();
    00322    virtual QxSqlQuery & closeParenthesis();
    00323
    00324    virtual QxSqlQuery & orderAsc(const QStringList & columns);
    00325    virtual QxSqlQuery & orderAsc(const QString & col1);
    00326    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2);
    00327    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3);
    00328    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00329    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00330    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00331    virtual QxSqlQuery & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00332    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);
    00333    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);
    00334
    00335    virtual QxSqlQuery & orderDesc(const QStringList & columns);
    00336    virtual QxSqlQuery & orderDesc(const QString & col1);
    00337    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2);
    00338    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3);
    00339    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00340    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00341    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00342    virtual QxSqlQuery & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00343    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);
    00344    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);
    00345
    00346    virtual QxSqlQuery & groupBy(const QStringList & columns);
    00347    virtual QxSqlQuery & groupBy(const QString & col1);
    00348    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2);
    00349    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3);
    00350    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4);
    00351    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5);
    00352    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6);
    00353    virtual QxSqlQuery & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7);
    00354    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);
    00355    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);
    00356
    00357    virtual QxSqlQuery & limit(int rowsCount, int startRow = 0);
    00358
    00359    virtual QxSqlQuery & like(const QString & val);
    00360    virtual QxSqlQuery & notLike(const QString & val);
    00361    virtual QxSqlQuery & startsWith(const QString & val);
    00362    virtual QxSqlQuery & endsWith(const QString & val);
    00363    virtual QxSqlQuery & containsString(const QString & val);
    00364
    00365    virtual QxSqlQuery & isEqualTo(const QVariant & val);
    00366    virtual QxSqlQuery & isNotEqualTo(const QVariant & val);
    00367    virtual QxSqlQuery & isGreaterThan(const QVariant & val);
    00368    virtual QxSqlQuery & isGreaterThanOrEqualTo(const QVariant & val);
    00369    virtual QxSqlQuery & isLessThan(const QVariant & val);
    00370    virtual QxSqlQuery & isLessThanOrEqualTo(const QVariant & val);
    00371    virtual QxSqlQuery & customOperator(const QString & sCustomOperator, const QVariant & val);
    00372
    00373    virtual QxSqlQuery & in(const QVariantList & values);
    00374    virtual QxSqlQuery & in(const QVariant & val1);
    00375    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2);
    00376    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3);
    00377    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4);
    00378    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5);
    00379    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6);
    00380    virtual QxSqlQuery & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7);
    00381    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);
    00382    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);
    00383
    00384    virtual QxSqlQuery & notIn(const QVariantList & values);
    00385    virtual QxSqlQuery & notIn(const QVariant & val1);
    00386    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2);
    00387    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3);
    00388    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4);
    00389    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5);
    00390    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6);
    00391    virtual QxSqlQuery & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7);
    00392    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);
    00393    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);
    00394
    00395    virtual QxSqlQuery & in_Select(const QString & sql);
    00396    virtual QxSqlQuery & notIn_Select(const QString & sql);
    00397
    00398    virtual QxSqlQuery & isNull();
    00399    virtual QxSqlQuery & isNotNull();
    00400
    00401    virtual QxSqlQuery & isBetween(const QVariant & val1, const QVariant & val2);
    00402    virtual QxSqlQuery & isNotBetween(const QVariant & val1, const QVariant & val2);
    00403
    00404    virtual QxSqlQuery & freeText(const QString & text);
    00405
    00406 private:
    00407
    00408    QxSqlQuery & addSqlExpression(const QString & column, qx::dao::detail::QxSqlExpression::type type);
    00409    QxSqlQuery & addSqlCompare(const QVariant & val, qx::dao::detail::QxSqlCompare::type type, const QString & sCustomOperator = QString());
    00410    QxSqlQuery & addSqlSort(const QStringList & columns, qx::dao::detail::QxSqlSort::type type);
    00411    QxSqlQuery & addSqlIn(const QVariantList & values, qx::dao::detail::QxSqlIn::type type);
    00412    QxSqlQuery & addSqlIsNull(qx::dao::detail::QxSqlIsNull::type type);
    00413    QxSqlQuery & addSqlIsBetween(const QVariant & val1, const QVariant & val2, qx::dao::detail::QxSqlIsBetween::type type);
    00414
    00415 };
    00416
    00417 } // namespace qx
    00418
    00419 typedef qx::QxSqlQuery qx_query;
    00420
    00421 namespace qx {
    00422 namespace dao {
    00423
    00447 QX_DLL_EXPORT QSqlError call_query(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL);
    00448
    00453 QX_DLL_EXPORT QSqlError call_query_without_prepare(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL);
    00454
    00455 namespace helper {
    00456
    00457 QX_DLL_EXPORT QSqlError call_query_helper(qx::QxSqlQuery & query, QSqlDatabase * pDatabase, bool bPrepare);
    00458
    00459 } // namespace helper
    00460 } // namespace dao
    00461 } // namespace qx
    00462
    00463 QX_REGISTER_CLASS_NAME(qx_query)
    00464
    00465 QX_CLASS_VERSION(qx::QxSqlQuery, 0)
    00466
    00467 #ifdef _QX_ENABLE_BOOST_SERIALIZATION
    00468 QX_SERIALIZE_FAST_COMPIL_SAVE_LOAD_HPP(QX_DLL_EXPORT, qx::QxSqlQuery)
    00469 #endif // _QX_ENABLE_BOOST_SERIALIZATION
    00470
    00471 #define QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_HPP(className) \
    00472 public: \
    00473 \
    00474 virtual className & distinct(); \
    00475 \
    00476 virtual className & where(const QString & column); \
    00477 virtual className & where_OpenParenthesis(const QString & column); \
    00478 virtual className & and_(const QString & column); \
    00479 virtual className & and_OpenParenthesis(const QString & column); \
    00480 virtual className & or_(const QString & column); \
    00481 virtual className & or_OpenParenthesis(const QString & column); \
    00482 \
    00483 virtual className & openParenthesis(); \
    00484 virtual className & closeParenthesis(); \
    00485 \
    00486 virtual className & orderAsc(const QStringList & columns); \
    00487 virtual className & orderAsc(const QString & col1); \
    00488 virtual className & orderAsc(const QString & col1, const QString & col2); \
    00489 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3); \
    00490 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00491 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00492 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00493 virtual className & orderAsc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00494 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); \
    00495 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); \
    00496 \
    00497 virtual className & orderDesc(const QStringList & columns); \
    00498 virtual className & orderDesc(const QString & col1); \
    00499 virtual className & orderDesc(const QString & col1, const QString & col2); \
    00500 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3); \
    00501 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00502 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00503 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00504 virtual className & orderDesc(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00505 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); \
    00506 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); \
    00507 \
    00508 virtual className & groupBy(const QStringList & columns); \
    00509 virtual className & groupBy(const QString & col1); \
    00510 virtual className & groupBy(const QString & col1, const QString & col2); \
    00511 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3); \
    00512 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4); \
    00513 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5); \
    00514 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6); \
    00515 virtual className & groupBy(const QString & col1, const QString & col2, const QString & col3, const QString & col4, const QString & col5, const QString & col6, const QString & col7); \
    00516 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); \
    00517 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); \
    00518 \
    00519 virtual className & limit(int rowsCount, int startRow = 0); \
    00520 \
    00521 virtual className & like(const QString & val); \
    00522 virtual className & notLike(const QString & val); \
    00523 virtual className & startsWith(const QString & val); \
    00524 virtual className & endsWith(const QString & val); \
    00525 virtual className & containsString(const QString & val); \
    00526 \
    00527 virtual className & isEqualTo(const QVariant & val); \
    00528 virtual className & isNotEqualTo(const QVariant & val); \
    00529 virtual className & isGreaterThan(const QVariant & val); \
    00530 virtual className & isGreaterThanOrEqualTo(const QVariant & val); \
    00531 virtual className & isLessThan(const QVariant & val); \
    00532 virtual className & isLessThanOrEqualTo(const QVariant & val); \
    00533 virtual className & customOperator(const QString & sCustomOperator, const QVariant & val); \
    00534 \
    00535 virtual className & in(const QVariantList & values); \
    00536 virtual className & in(const QVariant & val1); \
    00537 virtual className & in(const QVariant & val1, const QVariant & val2); \
    00538 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3); \
    00539 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4); \
    00540 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5); \
    00541 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6); \
    00542 virtual className & in(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7); \
    00543 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); \
    00544 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); \
    00545 \
    00546 virtual className & notIn(const QVariantList & values); \
    00547 virtual className & notIn(const QVariant & val1); \
    00548 virtual className & notIn(const QVariant & val1, const QVariant & val2); \
    00549 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3); \
    00550 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4); \
    00551 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5); \
    00552 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6); \
    00553 virtual className & notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3, const QVariant & val4, const QVariant & val5, const QVariant & val6, const QVariant & val7); \
    00554 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); \
    00555 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); \
    00556 \
    00557 virtual className & in_Select(const QString & sql); \
    00558 virtual className & notIn_Select(const QString & sql); \
    00559 \
    00560 virtual className & isNull(); \
    00561 virtual className & isNotNull(); \
    00562 \
    00563 virtual className & isBetween(const QVariant & val1, const QVariant & val2); \
    00564 virtual className & isNotBetween(const QVariant & val1, const QVariant & val2); \
    00565 \
    00566 virtual className & freeText(const QString & text);
    00567
    00568 #define QX_SQL_QUERY_DERIVED_IMPL_COVARIANT_RETURN_TYPE_CPP(className) \
    00569 \
    00570 className & className::distinct() { return static_cast<className &>(qx::QxSqlQuery::distinct()); } \
    00571 \
    00572 className & className::where(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::where(column)); } \
    00573 className & className::where_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::where_OpenParenthesis(column)); } \
    00574 className & className::and_(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::and_(column)); } \
    00575 className & className::and_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::and_OpenParenthesis(column)); } \
    00576 className & className::or_(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::or_(column)); } \
    00577 className & className::or_OpenParenthesis(const QString & column) { return static_cast<className &>(qx::QxSqlQuery::or_OpenParenthesis(column)); } \
    00578 \
    00579 className & className::openParenthesis() { return static_cast<className &>(qx::QxSqlQuery::openParenthesis()); } \
    00580 className & className::closeParenthesis() { return static_cast<className &>(qx::QxSqlQuery::closeParenthesis()); } \
    00581 \
    00582 className & className::orderAsc(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(columns)); } \
    00583 className & className::orderAsc(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1)); } \
    00584 className & className::orderAsc(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2)); } \
    00585 className & className::orderAsc(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::orderAsc(col1, col2, col3)); } \
    00586 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)); } \
    00587 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)); } \
    00588 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)); } \
    00589 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)); } \
    00590 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)); } \
    00591 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)); } \
    00592 \
    00593 className & className::orderDesc(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(columns)); } \
    00594 className & className::orderDesc(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1)); } \
    00595 className & className::orderDesc(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2)); } \
    00596 className & className::orderDesc(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::orderDesc(col1, col2, col3)); } \
    00597 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)); } \
    00598 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)); } \
    00599 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)); } \
    00600 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)); } \
    00601 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)); } \
    00602 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)); } \
    00603 \
    00604 className & className::groupBy(const QStringList & columns) { return static_cast<className &>(qx::QxSqlQuery::groupBy(columns)); } \
    00605 className & className::groupBy(const QString & col1) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1)); } \
    00606 className & className::groupBy(const QString & col1, const QString & col2) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2)); } \
    00607 className & className::groupBy(const QString & col1, const QString & col2, const QString & col3) { return static_cast<className &>(qx::QxSqlQuery::groupBy(col1, col2, col3)); } \
    00608 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)); } \
    00609 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)); } \
    00610 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)); } \
    00611 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)); } \
    00612 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)); } \
    00613 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)); } \
    00614 \
    00615 className & className::limit(int rowsCount, int startRow) { return static_cast<className &>(qx::QxSqlQuery::limit(rowsCount, startRow)); } \
    00616 \
    00617 className & className::like(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::like(val)); } \
    00618 className & className::notLike(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::notLike(val)); } \
    00619 className & className::startsWith(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::startsWith(val)); } \
    00620 className & className::endsWith(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::endsWith(val)); } \
    00621 className & className::containsString(const QString & val) { return static_cast<className &>(qx::QxSqlQuery::containsString(val)); } \
    00622 \
    00623 className & className::isEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isEqualTo(val)); } \
    00624 className & className::isNotEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isNotEqualTo(val)); } \
    00625 className & className::isGreaterThan(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isGreaterThan(val)); } \
    00626 className & className::isGreaterThanOrEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isGreaterThanOrEqualTo(val)); } \
    00627 className & className::isLessThan(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isLessThan(val)); } \
    00628 className & className::isLessThanOrEqualTo(const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::isLessThanOrEqualTo(val)); } \
    00629 className & className::customOperator(const QString & sCustomOperator, const QVariant & val) { return static_cast<className &>(qx::QxSqlQuery::customOperator(sCustomOperator, val)); } \
    00630 \
    00631 className & className::in(const QVariantList & values) { return static_cast<className &>(qx::QxSqlQuery::in(values)); } \
    00632 className & className::in(const QVariant & val1) { return static_cast<className &>(qx::QxSqlQuery::in(val1)); } \
    00633 className & className::in(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2)); } \
    00634 className & className::in(const QVariant & val1, const QVariant & val2, const QVariant & val3) { return static_cast<className &>(qx::QxSqlQuery::in(val1, val2, val3)); } \
    00635 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)); } \
    00636 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)); } \
    00637 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)); } \
    00638 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)); } \
    00639 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)); } \
    00640 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)); } \
    00641 \
    00642 className & className::notIn(const QVariantList & values) { return static_cast<className &>(qx::QxSqlQuery::notIn(values)); } \
    00643 className & className::notIn(const QVariant & val1) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1)); } \
    00644 className & className::notIn(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2)); } \
    00645 className & className::notIn(const QVariant & val1, const QVariant & val2, const QVariant & val3) { return static_cast<className &>(qx::QxSqlQuery::notIn(val1, val2, val3)); } \
    00646 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)); } \
    00647 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)); } \
    00648 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)); } \
    00649 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)); } \
    00650 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)); } \
    00651 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)); } \
    00652 \
    00653 className & className::in_Select(const QString & sql) { return static_cast<className &>(qx::QxSqlQuery::in_Select(sql)); } \
    00654 className & className::notIn_Select(const QString & sql) { return static_cast<className &>(qx::QxSqlQuery::notIn_Select(sql)); } \
    00655 \
    00656 className & className::isNull() { return static_cast<className &>(qx::QxSqlQuery::isNull()); } \
    00657 className & className::isNotNull() { return static_cast<className &>(qx::QxSqlQuery::isNotNull()); } \
    00658 \
    00659 className & className::isBetween(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::isBetween(val1, val2)); } \
    00660 className & className::isNotBetween(const QVariant & val1, const QVariant & val2) { return static_cast<className &>(qx::QxSqlQuery::isNotBetween(val1, val2)); } \
    00661 \
    00662 className & className::freeText(const QString & text) { return static_cast<className &>(qx::QxSqlQuery::freeText(text)); }
    00663
    00664 #endif // _QX_SQL_QUERY_H_