# TKeySQL* TKeySQL represents meta-inforamtion about object, which was written to SQL database. It keeps object id, which used to locate object data from database tables. ```cpp class TKeySQL : public TKey ``` ## class ```cpp private: TKeySQL(const TKeySQL &); // TKeySQL objects are not copiable. TKeySQL &operator=(const TKeySQL &); // TKeySQL objects are not copiable. protected: TKeySQL(); virtual Int_t Read(const char *name) { return TKey::Read(name); } void StoreKeyObject(const void *obj, const TClass *cl); /// Stores object, associated with key, into data tables void *ReadKeyObject(void *obj, const TClass *expectedClass); /// Read object, associated with key, from database Long64_t fKeyId; /// 0 ? GetDBObjId() : 0; } virtual Long64_t GetSeekPdir() const { return GetDBDirId() > 0 ? GetDBDirId() : 0; } virtual void Keep() {} virtual Int_t Read(TObject *obj); /// To read an object from the file. /// The object associated to this key is read from the file into memory. /// Before invoking this function, obj has been created via the /// default constructor. virtual TObject *ReadObj(); /// Read object derived from TObject class /// If it is not TObject or in case of error, return 0 virtual TObject *ReadObjWithBuffer(char *bufferRead); /// Read object derived from TObject class /// If it is not TObject or in case of error, return 0 virtual void *ReadObjectAny(const TClass *expectedClass); /// Read object of any type from SQL database virtual void ReadBuffer(char *&) {} virtual Bool_t ReadFile() { return kTRUE; } virtual void SetBuffer() { fBuffer = 0; } virtual Int_t WriteFile(Int_t = 1, TFile * = 0) { return 0; } ```