00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef RESOURCEPOOL_SQL_RTSQLSELECT_HH
00025 #define RESOURCEPOOL_SQL_RTSQLSELECT_HH
00026
00027 #include "mm/gc_ptr.hh"
00028 #include "ResourcePool/SQL/RTSQLCommand.hh"
00029 #include "ResourcePool/SQL/Resource.hh"
00030 #include "ResourcePool/SQL/BindInterface.hh"
00031 #include "ResourcePool/SQL/BindOutInterface.hh"
00032 #include "ResourcePool/SQL/RTCommandParameters.hh"
00033 #include "ResourcePool/SQL/RTSQLSelectRow.hh"
00034 #include "ResourcePool/SQL/SQLFetcher.hh"
00035
00036 namespace fatalmind {
00037 namespace SQL {
00038
00039 template<class TM> class RTSQLSelectRow_Impl;
00040
00053 template<class TM>
00054 class RTSQLSelect
00055 : public RTSQLCommand<TM>
00056 , public BindInterface
00057 , public BindOutInterface
00058 {
00059 public:
00060 RTSQLSelect(const ResourcePool<ResourceType<TM> >& p, const std::string& sql, SQL::SQLFetcher& fetcher);
00061 RTSQLSelect(const RTSQLSelect<TM>& rho);
00062 virtual ~RTSQLSelect();
00063
00064 template<typename T>
00065 void bind(const unsigned int pos, const T& val, bool nul = false);
00066
00067 template<typename T>
00068 void bindout(const unsigned int pos, T& val, bool& isnull);
00069
00070 template<typename T>
00071 void bindout(const unsigned int pos, T& val, BindOutNotNullConstraint = NOTNULL);
00072
00073 virtual void clearParameters();
00074
00075
00076
00077 void execute(typename ResourceType<TM>::resource_t& hand);
00078 virtual void outputoperator(std::ostream&) const;
00079
00080 virtual const Clone* getPlainSpecializedCommand() const;
00081
00082 protected:
00083 virtual Clone* DoClone() const {
00084 return new RTSQLSelect<TM>(*this);
00085 }
00086 private:
00087 gc_ptr<RTSQLSelectRow_Impl<TM> > _realSQLExecute;
00088
00089 typedef typename SQLFactory<TM>::databaseType_t databaseType_t;
00090 };
00091
00092
00093 }
00094 }
00095 #endif