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_RTSQLSELECTROW_HH
00025 #define RESOURCEPOOL_SQL_RTSQLSELECTROW_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/SQLFetcher.hh"
00034
00035 namespace fatalmind {
00036 namespace SQL {
00037
00038 template<class TM> class RTSQLSelectRow_Impl;
00039
00040
00053 template<class TM>
00054 class RTSQLSelectRow
00055 : public RTSQLCommand<TM>
00056 , public BindInterface
00057 , public BindOutInterface
00058 {
00059 public:
00060 RTSQLSelectRow(const ResourcePool<ResourceType<TM> >& p, const std::string& sql, SQL::SQLFetcher& fetcher = SQL::NopFetcher);
00061 virtual ~RTSQLSelectRow();
00062
00063 template<typename T>
00064 void bind(const unsigned int pos, const T& val, bool nul = false);
00065
00066 void clearParameters();
00067
00068 template<typename T>
00069 void bindout(const unsigned int pos, T& val, bool& isnull);
00070
00071 template<typename T>
00072 void bindout(const unsigned int pos, T& val, BindOutInterface::BindOutNotNullConstraint = NOTNULL);
00073
00074
00075
00076 void execute(typename ResourceType<TM>::resource_t& hand);
00077
00078 virtual void outputoperator(std::ostream&) const;
00079 virtual const Clone* getPlainSpecializedCommand() const;
00080 protected:
00081 virtual Clone* DoClone() const {
00082 return new RTSQLSelectRow<TM>(*this);
00083 }
00084 private:
00085 gc_ptr<RTSQLSelectRow_Impl<TM> > _realSQLExecute;
00086
00087 typedef typename SQLFactory<TM>::databaseType_t databaseType_t;
00088 };
00089
00090
00091 }
00092 }
00093 #endif