Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

query.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the KDB libraries
00003    Copyright (c) 2000 Praduroux Alessandro <pradu@thekompany.com>
00004  
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009  
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014  
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */     
00020 #ifndef QUERY_H
00021 #define QUERY_H
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include <qstring.h>
00028 #include <qstringlist.h>
00029 
00030 #include <ksharedptr.h>
00031 
00032 #include "recordset.h"
00033 #include "dataobject.h"
00034 
00035 namespace KDB {
00036 
00037 class Connector;
00038 class Recordset;
00039 
00040 class Query;
00041 
00042 typedef KSharedPtr<Query>            QueryPtr;
00043 typedef QValueList<QueryPtr>         QueryList;
00044 typedef QValueListIterator<QueryPtr> QueryIterator;
00045 
00060 class Query :public DataObject{
00061 
00062     friend class Database;
00063     Q_OBJECT
00064 
00065  public:
00066 
00067      ~Query();
00068 
00073      void addField(const QString &table, const QString &name);
00074 
00078      void addTable(const QString &name) ;
00079 
00083      void addCondition(const QString &condition);
00084 
00090      QString SQL();
00091 
00095      RecordsetPtr openRecordset();
00096 
00100      bool isDesign() ;
00101      
00102  protected:
00103 
00104     Query( Connector * conn, const char * name, QObject *parent = 0, const QString &sql = QString::null );
00105 
00111     virtual void buildSQL();
00112 
00113  private:
00114 
00115     QString m_SQL;
00116 
00117     QStringList m_fields;
00118     QStringList m_tables;
00119     QStringList m_conditions;
00120 
00121     Connector * connector;
00122 };
00123 
00124 }
00125 
00126 #endif

Generated at Fri Sep 29 16:32:21 2000 for KDB by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000