![]() |
![]() |
#include <OnlineDB/EcalCondDB/interface/RunCommentDat.h>
Public Member Functions | |
std::string | getComment () const |
Tm | getDBTime () const |
std::string | getSource () const |
std::string | getTable () |
RunCommentDat () | |
void | setComment (string x) |
void | setDBTime (Tm x) |
void | setSource (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 | ( | ) |
Definition at line 16 of file RunCommentDat.cc.
References m_comment, IDBObject::m_conn, IDBObject::m_env, m_source, m_time, IDataItem::m_writeStmt, and NULL.
00017 { 00018 m_env = NULL; 00019 m_conn = NULL; 00020 m_writeStmt = NULL; 00021 m_source = ""; 00022 m_comment = ""; 00023 m_time = Tm(); 00024 }
RunCommentDat::~RunCommentDat | ( | ) |
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 IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00036 { 00037 this->checkConnection(); 00038 00039 try { 00040 m_writeStmt = m_conn->createStatement(); 00041 m_writeStmt->setSQL("INSERT INTO run_comment_dat (iov_id, " 00042 "source, user_comment) " 00043 "VALUES (:iov_id, " 00044 ":source, :user_comment)"); 00045 } catch (SQLException &e) { 00046 throw(runtime_error("RunCommentDat::prepareWrite(): "+e.getMessage())); 00047 } 00048 }
void RunCommentDat::setComment | ( | string | x | ) | [inline] |
void RunCommentDat::setSource | ( | 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 IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00054 { 00055 this->checkConnection(); 00056 this->checkPrepare(); 00057 00058 int iovID = iov->fetchID(); 00059 if (!iovID) { throw(runtime_error("RunCommentDat::writeDB: IOV not in DB")); } 00060 00061 try { 00062 m_writeStmt->setInt(1, iovID); 00063 m_writeStmt->setString(2, item->getSource()); 00064 m_writeStmt->setString(3, item->getComment()); 00065 00066 m_writeStmt->executeUpdate(); 00067 } catch (SQLException &e) { 00068 throw(runtime_error("RunCommentDat::writeDB(): "+e.getMessage())); 00069 } 00070 }
friend class EcalCondDBInterface [friend] |
std::string RunCommentDat::m_comment [private] |
Definition at line 39 of file RunCommentDat.h.
Referenced by getComment(), RunCommentDat(), and setComment().
std::string RunCommentDat::m_source [private] |
Definition at line 38 of file RunCommentDat.h.
Referenced by getSource(), RunCommentDat(), and setSource().
Tm RunCommentDat::m_time [private] |
Definition at line 40 of file RunCommentDat.h.
Referenced by getDBTime(), RunCommentDat(), and setDBTime().