#include <RunCommentDat.h>
Public Member Functions | |
std::string | getComment () const |
Tm | getDBTime () const |
std::string | getSource () const |
std::string | getTable () |
RunCommentDat () | |
void | setComment (std::string x) |
void | setDBTime (Tm x) |
void | setSource (std::string x) |
~RunCommentDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunCommentDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunCommentDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
std::string | m_comment |
std::string | m_source |
Tm | m_time |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunCommentDat.h.
RunCommentDat::RunCommentDat | ( | ) |
RunCommentDat::~RunCommentDat | ( | ) |
Definition at line 28 of file RunCommentDat.cc.
{ }
void RunCommentDat::fetchData | ( | std::map< EcalLogicID, RunCommentDat > * | fillMap, |
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
std::string RunCommentDat::getComment | ( | ) | const [inline] |
Tm RunCommentDat::getDBTime | ( | ) | const [inline] |
std::string RunCommentDat::getSource | ( | ) | const [inline] |
std::string RunCommentDat::getTable | ( | ) | [inline, virtual] |
void RunCommentDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 34 of file RunCommentDat.cc.
References alignCSCRings::e.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO run_comment_dat (iov_id, " "source, user_comment) " "VALUES (:iov_id, " ":source, :user_comment)"); } catch (SQLException &e) { throw(std::runtime_error("RunCommentDat::prepareWrite(): "+e.getMessage())); } }
void RunCommentDat::setComment | ( | std::string | x | ) | [inline] |
void RunCommentDat::setDBTime | ( | Tm | x | ) | [inline] |
void RunCommentDat::setSource | ( | std::string | x | ) | [inline] |
void RunCommentDat::writeDB | ( | const EcalLogicID * | ecid, |
const RunCommentDat * | item, | ||
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 52 of file RunCommentDat.cc.
References alignCSCRings::e, and o2o::iov.
{ this->checkConnection(); this->checkPrepare(); int iovID = iov->fetchID(); if (!iovID) { throw(std::runtime_error("RunCommentDat::writeDB: IOV not in DB")); } try { m_writeStmt->setInt(1, iovID); m_writeStmt->setString(2, item->getSource()); m_writeStmt->setString(3, item->getComment()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("RunCommentDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 13 of file RunCommentDat.h.
std::string RunCommentDat::m_comment [private] |
Definition at line 39 of file RunCommentDat.h.
Referenced by getComment(), and setComment().
std::string RunCommentDat::m_source [private] |
Definition at line 38 of file RunCommentDat.h.
Referenced by getSource(), and setSource().
Tm RunCommentDat::m_time [private] |
Definition at line 40 of file RunCommentDat.h.
Referenced by getDBTime(), and setDBTime().