QxOrm 1.1.6
C++ Object Relational Mapping library
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 namespace qx {
00044 
00045 class IxSqlQueryBuilder;
00046 
00051 class QxSqlRelationParams
00052 {
00053 
00054 protected:
00055 
00056    long                 m_lIndex;      
00057    long                 m_lOffset;     
00058    QString *            m_sql;         
00059    IxSqlQueryBuilder *  m_builder;     
00060    QSqlQuery *          m_query;       
00061    QSqlDatabase *       m_database;    
00062    void *               m_pOwner;      
00063 
00064 public:
00065 
00066    QxSqlRelationParams() : m_lIndex(0), m_lOffset(0), m_sql(NULL), m_builder(NULL), m_query(NULL), m_database(NULL), m_pOwner(NULL) { ; }
00067    QxSqlRelationParams(long lIndex, long lOffset, QString * sql, IxSqlQueryBuilder * builder, QSqlQuery * query, void * pOwner) : m_lIndex(lIndex), m_lOffset(lOffset), m_sql(sql), m_builder(builder), m_query(query), m_database(NULL), m_pOwner(pOwner) { ; }
00068    virtual ~QxSqlRelationParams() { ; }
00069 
00070    inline long index() const                          { return m_lIndex; }
00071    inline long offset() const                         { return m_lOffset; }
00072    inline QString & sql()                             { qAssert(m_sql); return (* m_sql); }
00073    inline const QString & sql() const                 { qAssert(m_sql); return (* m_sql); }
00074    inline QSqlQuery & query()                         { qAssert(m_query); return (* m_query); }
00075    inline const QSqlQuery & query() const             { qAssert(m_query); return (* m_query); }
00076    inline QSqlDatabase & database()                   { qAssert(m_database); return (* m_database); }
00077    inline const QSqlDatabase & database() const       { qAssert(m_database); return (* m_database); }
00078    inline IxSqlQueryBuilder & builder()               { qAssert(m_builder); return (* m_builder); }
00079    inline const IxSqlQueryBuilder & builder() const   { qAssert(m_builder); return (* m_builder); }
00080    inline void * owner() const                        { return m_pOwner; }
00081 
00082    inline void setIndex(long lIndex)                     { m_lIndex = lIndex; }
00083    inline void setOffset(long lOffset)                   { m_lOffset = lOffset; }
00084    inline void setSql(QString * sql)                     { m_sql = sql; }
00085    inline void setBuilder(IxSqlQueryBuilder * builder)   { m_builder = builder; }
00086    inline void setQuery(QSqlQuery * query)               { m_query = query; }
00087    inline void setDatabase(QSqlDatabase * database)      { m_database = database; }
00088    inline void setOwner(void * pOwner)                   { m_pOwner = pOwner; }
00089 
00090 };
00091 
00092 } // namespace qx
00093 
00094 #endif // _QX_SQL_RELATION_PARAMS_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines