| QxOrm 1.2.4 C++ Object Relational Mapping library

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

- File List
- File Members

QxSqlRelationParams.h
Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** http://www.qxorm.com/
    00004 ** http://sourceforge.net/projects/qxorm/
    00005 ** Original file by Lionel Marty
    00006 **
    00007 ** This file is part of the QxOrm library
    00008 **
    00009 ** This software is provided 'as-is', without any express or implied
    00010 ** warranty. In no event will the authors be held liable for any
    00011 ** damages arising from the use of this software.
    00012 **
    00013 ** GNU Lesser General Public License Usage
    00014 ** This file must be used under the terms of the GNU Lesser
    00015 ** General Public License version 2.1 as published by the Free Software
    00016 ** Foundation and appearing in the file 'license.lgpl.txt' included in the
    00017 ** packaging of this file.  Please review the following information to
    00018 ** ensure the GNU Lesser General Public License version 2.1 requirements
    00019 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    00020 **
    00021 ** If you have questions regarding the use of this file, please contact :
    00022 ** contact@qxorm.com
    00023 **
    00024 ****************************************************************************/
    00025
    00026 #ifndef _QX_SQL_RELATION_PARAMS_H_
    00027 #define _QX_SQL_RELATION_PARAMS_H_
    00028
    00029 #ifdef _MSC_VER
    00030 #pragma once
    00031 #endif
    00032
    00040 #include <QtSql/qsqldatabase.h>
    00041 #include <QtSql/qsqlquery.h>
    00042
    00043 #include <QxDao/QxSqlJoin.h>
    00044
    00045 namespace qx {
    00046
    00047 class IxSqlQueryBuilder;
    00048
    00053 class QxSqlRelationParams
    00054 {
    00055
    00056 protected:
    00057
    00058    QVariant                      m_vId;
    00059    long                          m_lIndex;
    00060    long                          m_lIndexOwner;
    00061    long                          m_lOffset;
    00062    QString *                     m_sql;
    00063    IxSqlQueryBuilder *           m_builder;
    00064    QSqlQuery *                   m_query;
    00065    QSqlDatabase *                m_database;
    00066    void *                        m_pOwner;
    00067    qx::dao::sql_join::join_type  m_eJoinType;
    00068
    00069 public:
    00070
    00071    QxSqlRelationParams() : m_lIndex(0), m_lIndexOwner(0), m_lOffset(0), m_sql(NULL), m_builder(NULL), m_query(NULL), m_database(NULL), m_pOwner(NULL), m_eJoinType(qx::dao::sql_join::no_join) { ; }
    00072    QxSqlRelationParams(long lIndex, long lOffset, QString * sql, IxSqlQueryBuilder * builder, QSqlQuery * query, void * pOwner) : m_lIndex(lIndex), m_lIndexOwner(0), m_lOffset(lOffset), m_sql(sql), m_builder(builder), m_query(query), m_database(NULL), m_pOwner(pOwner), m_eJoinType(qx::dao::sql_join::no_join) { ; }
    00073    QxSqlRelationParams(long lIndex, long lOffset, QString * sql, IxSqlQueryBuilder * builder, QSqlQuery * query, void * pOwner, const QVariant & vId) : m_vId(vId), m_lIndex(lIndex), m_lIndexOwner(0), m_lOffset(lOffset), m_sql(sql), m_builder(builder), m_query(query), m_database(NULL), m_pOwner(pOwner), m_eJoinType(qx::dao::sql_join::no_join) { ; }
    00074    virtual ~QxSqlRelationParams() { ; }
    00075
    00076    inline QVariant id() const                            { return m_vId; }
    00077    inline long index() const                             { return m_lIndex; }
    00078    inline long indexOwner() const                        { return m_lIndexOwner; }
    00079    inline long offset() const                            { return m_lOffset; }
    00080    inline QString & sql()                                { qAssert(m_sql); return (* m_sql); }
    00081    inline const QString & sql() const                    { qAssert(m_sql); return (* m_sql); }
    00082    inline QSqlQuery & query()                            { qAssert(m_query); return (* m_query); }
    00083    inline const QSqlQuery & query() const                { qAssert(m_query); return (* m_query); }
    00084    inline QSqlDatabase & database()                      { qAssert(m_database); return (* m_database); }
    00085    inline const QSqlDatabase & database() const          { qAssert(m_database); return (* m_database); }
    00086    inline IxSqlQueryBuilder & builder()                  { qAssert(m_builder); return (* m_builder); }
    00087    inline const IxSqlQueryBuilder & builder() const      { qAssert(m_builder); return (* m_builder); }
    00088    inline void * owner() const                           { return m_pOwner; }
    00089    inline qx::dao::sql_join::join_type joinType() const  { return m_eJoinType; }
    00090
    00091    inline void setId(const QVariant & vId)                  { m_vId = vId; }
    00092    inline void setIndex(long lIndex)                        { m_lIndex = lIndex; }
    00093    inline void setIndexOwner(long lIndex)                   { m_lIndexOwner = lIndex; }
    00094    inline void setOffset(long lOffset)                      { m_lOffset = lOffset; }
    00095    inline void setSql(QString * sql)                        { m_sql = sql; }
    00096    inline void setBuilder(IxSqlQueryBuilder * builder)      { m_builder = builder; }
    00097    inline void setQuery(QSqlQuery * query)                  { m_query = query; }
    00098    inline void setDatabase(QSqlDatabase * database)         { m_database = database; }
    00099    inline void setOwner(void * pOwner)                      { m_pOwner = pOwner; }
    00100    inline void setJoinType(qx::dao::sql_join::join_type e)  { m_eJoinType = e; }
    00101
    00102 };
    00103
    00104 } // namespace qx
    00105
    00106 #endif // _QX_SQL_RELATION_PARAMS_H_