Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:32:02

0001 #include "OnlineDB/EcalCondDB/interface/LMFTrigType.h"
0002 
0003 using namespace std;
0004 using namespace oracle::occi;
0005 
0006 LMFTrigType::LMFTrigType() {
0007   setClassName("LMFTrigType");
0008   m_stringFields["short_name"] = "";
0009   m_stringFields["long_name"] = "";
0010 }
0011 
0012 LMFTrigType::LMFTrigType(oracle::occi::Environment *env, oracle::occi::Connection *conn) : LMFUnique(env, conn) {
0013   setClassName("LMFTrigType");
0014   m_stringFields["short_name"] = "";
0015   m_stringFields["long_name"] = "";
0016 }
0017 
0018 LMFTrigType::LMFTrigType(EcalDBConnection *c) : LMFUnique(c) {
0019   setClassName("LMFTrigType");
0020   m_stringFields["short_name"] = "";
0021   m_stringFields["long_name"] = "";
0022 }
0023 
0024 LMFTrigType::~LMFTrigType() {}
0025 
0026 LMFTrigType &LMFTrigType::setName(std::string s) {
0027   setString("short_name", s);
0028   fetchID();
0029   return *this;
0030 }
0031 
0032 std::string LMFTrigType::fetchIdSql(Statement *stmt) {
0033   std::string sql =
0034       "SELECT TRIG_TYPE, SNAME, LNAME FROM "
0035       "CMS_ECAL_LASER_COND.LMF_TRIG_TYPE_DEF "
0036       "WHERE "
0037       "SNAME   = :1";
0038   stmt->setSQL(sql);
0039   stmt->setString(1, getShortName());
0040   return sql;
0041 }
0042 
0043 std::string LMFTrigType::setByIDSql(Statement *stmt, int id) {
0044   std::string sql =
0045       "SELECT SNAME, LNAME FROM "
0046       "CMS_ECAL_LASER_COND.LMF_TRIG_TYPE_DEF "
0047       "WHERE TRIG_TYPE = :1";
0048   stmt->setSQL(sql);
0049   stmt->setInt(1, id);
0050   return sql;
0051 }
0052 
0053 void LMFTrigType::getParameters(ResultSet *rset) {
0054   setString("short_name", rset->getString(1));
0055   setString("long_name", rset->getString(2));
0056 }
0057 
0058 LMFTrigType *LMFTrigType::createObject() const {
0059   LMFTrigType *t = new LMFTrigType();
0060   t->setConnection(m_env, m_conn);
0061   return t;
0062 }
0063 
0064 std::string LMFTrigType::fetchAllSql(Statement *stmt) const {
0065   std::string sql =
0066       "SELECT TRIG_TYPE FROM "
0067       "CMS_ECAL_LASER_COND.LMF_TRIG_TYPE_DEF";
0068   stmt->setSQL(sql);
0069   return sql;
0070 }