#include <OnlineDB/EcalCondDB/interface/RunConfigDat.h>
Public Member Functions | |
std::string | getConfigTag () const |
int | getConfigVersion () const |
std::string | getTable () |
RunConfigDat () | |
void | setConfigTag (std::string tag) |
void | setConfigVersion (int ver) |
~RunConfigDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunConfigDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunConfigDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
std::string | m_configTag |
int | m_configVer |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunConfigDat.h.
RunConfigDat::RunConfigDat | ( | ) |
Definition at line 11 of file RunConfigDat.cc.
References m_configTag, m_configVer, IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, IDataItem::m_writeStmt, and NULL.
00012 { 00013 m_env = NULL; 00014 m_conn = NULL; 00015 m_writeStmt = NULL; 00016 m_readStmt = NULL; 00017 00018 m_configTag = "none"; 00019 m_configVer = 0; 00020 }
RunConfigDat::~RunConfigDat | ( | ) |
void RunConfigDat::fetchData | ( | std::map< EcalLogicID, RunConfigDat > * | fillMap, | |
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
std::string RunConfigDat::getConfigTag | ( | ) | const [inline] |
int RunConfigDat::getConfigVersion | ( | ) | const [inline] |
std::string RunConfigDat::getTable | ( | ) | [inline, virtual] |
void RunConfigDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 30 of file RunConfigDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00032 { 00033 this->checkConnection(); 00034 00035 try { 00036 m_writeStmt = m_conn->createStatement(); 00037 m_writeStmt->setSQL("INSERT INTO run_config_dat (iov_id, logic_id, " 00038 "config_tag, config_ver) " 00039 "VALUES (:iov_id, :logic_id, " 00040 ":config_tag, :config_ver)"); 00041 } catch (SQLException &e) { 00042 throw(runtime_error("RunConfigDat::prepareWrite(): "+e.getMessage())); 00043 } 00044 }
void RunConfigDat::setConfigTag | ( | std::string | tag | ) | [inline] |
void RunConfigDat::writeDB | ( | const EcalLogicID * | ecid, | |
const RunConfigDat * | item, | |||
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 48 of file RunConfigDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00050 { 00051 this->checkConnection(); 00052 this->checkPrepare(); 00053 00054 int iovID = iov->fetchID(); 00055 if (!iovID) { throw(runtime_error("RunConfigDat::writeDB: IOV not in DB")); } 00056 00057 int logicID = ecid->getLogicID(); 00058 if (!logicID) { throw(runtime_error("RunConfigDat::writeDB: Bad EcalLogicID")); } 00059 00060 try { 00061 m_writeStmt->setInt(1, iovID); 00062 m_writeStmt->setInt(2, logicID); 00063 m_writeStmt->setString(3, item->getConfigTag()); 00064 m_writeStmt->setInt(4, item->getConfigVersion()); 00065 00066 m_writeStmt->executeUpdate(); 00067 } catch (SQLException &e) { 00068 throw(runtime_error("RunConfigDat::writeDB(): "+e.getMessage())); 00069 } 00070 }
friend class EcalCondDBInterface [friend] |
std::string RunConfigDat::m_configTag [private] |
Definition at line 37 of file RunConfigDat.h.
Referenced by getConfigTag(), RunConfigDat(), and setConfigTag().
int RunConfigDat::m_configVer [private] |
Definition at line 38 of file RunConfigDat.h.
Referenced by getConfigVersion(), RunConfigDat(), and setConfigVersion().