QxOrm  1.2.3
C++ Object Relational Mapping library
IxSqlGenerator.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 _IX_SQL_GENERATOR_H_
00027 #define _IX_SQL_GENERATOR_H_
00028 
00029 #ifdef _MSC_VER
00030 #pragma once
00031 #endif
00032 
00040 #include <QtSql/qsqlquery.h>
00041 
00042 namespace qx {
00043 namespace dao {
00044 namespace detail {
00045 
00046 class IxDao_Helper;
00047 class IxSqlElement;
00048 class QxSqlCompare;
00049 class QxSqlElementTemp;
00050 class QxSqlExpression;
00051 class QxSqlFreeText;
00052 class QxSqlIn;
00053 class QxSqlIsBetween;
00054 class QxSqlIsNull;
00055 class QxSqlLimit;
00056 class QxSqlSort;
00057 
00062 class QX_DLL_EXPORT IxSqlGenerator
00063 {
00064 
00065 public:
00066 
00067    IxSqlGenerator();
00068    virtual ~IxSqlGenerator();
00069 
00070    virtual QString getAutoIncrement() const = 0;
00071    virtual QString getWildCard() const = 0;
00072    virtual QString getLimit(const QxSqlLimit * pLimit) const = 0;
00073    virtual void resolveLimit(QSqlQuery & query, const QxSqlLimit * pLimit) const = 0;
00074    virtual void postProcess(QString & sql, const QxSqlLimit * pLimit) const = 0;
00075    virtual void onBeforeInsert(IxDao_Helper * pDaoHelper, void * pOwner) const = 0;
00076    virtual void onAfterInsert(IxDao_Helper * pDaoHelper, void * pOwner) const = 0;
00077    virtual void onBeforeUpdate(IxDao_Helper * pDaoHelper, void * pOwner) const = 0;
00078    virtual void onAfterUpdate(IxDao_Helper * pDaoHelper, void * pOwner) const = 0;
00079    virtual void onBeforeDelete(IxDao_Helper * pDaoHelper, void * pOwner) const = 0;
00080    virtual void onAfterDelete(IxDao_Helper * pDaoHelper, void * pOwner) const = 0;
00081 
00082 };
00083 
00084 typedef boost::shared_ptr<IxSqlGenerator> IxSqlGenerator_ptr;
00085 
00086 } // namespace detail
00087 } // namespace dao
00088 } // namespace qx
00089 
00090 #endif // _IX_SQL_GENERATOR_H_