CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
FEConfigMainInfo Class Reference

#include <FEConfigMainInfo.h>

Inheritance diagram for FEConfigMainInfo:
IODConfig IDBObject

Public Member Functions

 FEConfigMainInfo ()
 
int getBstId () const
 
int getBttId () const
 
int getBxtId () const
 
Tm getDBTime () const
 
std::string getDescription () const
 
int getFgrId () const
 
int getId () const
 
int getLinId () const
 
int getLUTId () const
 
int getPedId () const
 
int getSliId () const
 
int getSpiId () const
 
std::string getTable ()
 
int getTimId () const
 
int getVersion () const
 
int getWeiId () const
 
bool operator!= (const FEConfigMainInfo &r) const
 
bool operator== (const FEConfigMainInfo &r) const
 
void setBstId (int x)
 
void setBttId (int x)
 
void setBxtId (int x)
 
void setDBTime (const Tm &x)
 
void setDescription (std::string x)
 
void setFgrId (int x)
 
void setId (int id)
 
void setLinId (int x)
 
void setLUTId (int x)
 
void setPedId (int x)
 
void setSliId (int x)
 
void setSpiId (int x)
 
void setTimId (int x)
 
void setVersion (int id)
 
void setWeiId (int x)
 
 ~FEConfigMainInfo ()
 
- Public Member Functions inherited from IODConfig
std::string getConfigTag ()
 
void setConfigTag (std::string x)
 
- Public Member Functions inherited from IDBObject
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void setConnection (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
virtual ~IDBObject ()
 

Private Member Functions

void clear ()
 
void fetchData (FEConfigMainInfo *result) throw (std::runtime_error)
 
int fetchID () throw (std::runtime_error)
 
int fetchIDLast () throw (std::runtime_error)
 
int fetchNextId () throw (std::runtime_error)
 
void insertConfig () throw (std::runtime_error)
 
void prepareWrite () throw (std::runtime_error)
 
void setByID (int id) throw (std::runtime_error)
 
void writeDB () throw (std::runtime_error)
 

Private Attributes

int m_bst_id
 
int m_btt_id
 
int m_bxt_id
 
Tm m_db_time
 
std::string m_description
 
int m_fgr_id
 
int m_ID
 
int m_lin_id
 
int m_lut_id
 
int m_ped_id
 
int m_sli_id
 
int m_spi_id
 
int m_tim_id
 
int m_version
 
int m_wei_id
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Public Types inherited from IODConfig
typedef oracle::occi::Clob Clob
 
typedef oracle::occi::SQLException SQLException
 
typedef oracle::occi::Statement Statement
 
typedef oracle::occi::Stream Stream
 
- Public Attributes inherited from IODConfig
std::string m_config_tag
 
- Static Public Attributes inherited from IDBObject
static int const ECALDB_NROWS =1024
 
- Protected Member Functions inherited from IODConfig
void checkPrepare () throw (std::runtime_error)
 
void createReadStatement () throw (std::runtime_error)
 
void populateClob (Clob &clob, std::string fname, unsigned int bufsize) throw (std::runtime_error)
 
unsigned char * readClob (Clob &clob, int size) throw (std::runtime_error)
 
void setPrefetchRowCount (int ncount) throw (std::runtime_error)
 
void terminateReadStatement () throw (std::runtime_error)
 
void terminateWriteStatement () throw (std::runtime_error)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const throw (std::runtime_error)
 
- Protected Attributes inherited from IODConfig
Statementm_readStmt
 
Statementm_writeStmt
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 19 of file FEConfigMainInfo.h.

Constructor & Destructor Documentation

FEConfigMainInfo::FEConfigMainInfo ( )

Definition at line 12 of file FEConfigMainInfo.cc.

References hitfit::clear(), and NULL.

13 {
14  m_env = NULL;
15  m_conn = NULL;
16  m_writeStmt = NULL;
17  m_readStmt = NULL;
18 
19  m_ID=0;
20  m_version=0;
21  clear();
22 
23 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Statement * m_writeStmt
Definition: IODConfig.h:36
#define NULL
Definition: scimark2.h:8
Statement * m_readStmt
Definition: IODConfig.h:37
FEConfigMainInfo::~FEConfigMainInfo ( )

Definition at line 27 of file FEConfigMainInfo.cc.

27 {}

Member Function Documentation

void FEConfigMainInfo::clear ( void  )
private

Definition at line 30 of file FEConfigMainInfo.cc.

30  {
31 
32  m_description="";
33  m_ped_id=0;
34  m_lin_id=0;
35  m_lut_id=0;
36  m_sli_id=0;
37  m_fgr_id=0;
38  m_wei_id=0;
39  m_bxt_id=0;
40  m_btt_id=0;
41  m_tim_id=0;
42  m_spi_id=0;
43  m_bst_id=0;
44 
45  m_db_time=Tm();
46 
47 
48 }
std::string m_description
Definition: Tm.h:13
void FEConfigMainInfo::fetchData ( FEConfigMainInfo result)
throw (std::runtime_error
)
private

Definition at line 263 of file FEConfigMainInfo.cc.

References gather_cfg::cout, DateHandler::dateToTm(), cuy::dh, alignCSCRings::e, and query::result.

265 { std::cout << " ### 1 getId from FEConfigMainInfo = " << result->getId() << std::endl;
266  std::cout << " tag/version " << result->getConfigTag() <<"/"<<result->getVersion() << std::endl;
267 
268  this->checkConnection();
270  // result->clear();
271 
272  int idid=0;
273 
274  if(result->getId()==0){
275  //throw(std::runtime_error("FEConfigMainInfo::fetchData(): no Id defined for this FEConfigMainInfo "));
276  idid=result->fetchID();
277  result->setId(idid);
278  }
279 
280  try {
281  m_readStmt->setSQL("SELECT * FROM FE_CONFIG_MAIN WHERE conf_id = :1 ");
282 
283  std::cout << " ### 2 getId from FEConfigMainInfo = " << result->getId() << std::endl;
284 
285  // good m_readStmt->setInt(1, result->getId());
286  m_readStmt->setInt(1, result->getId());
287  ResultSet* rset = m_readStmt->executeQuery();
288 
289  rset->next();
290 
291  result->setId( rset->getInt(1) );
292 
293  setPedId( rset->getInt(2) );
294  setLinId( rset->getInt(3) );
295  setLUTId( rset->getInt(4) );
296  setFgrId( rset->getInt(5) );
297  setSliId( rset->getInt(6) );
298  setWeiId( rset->getInt(7) );
299  setSpiId( rset->getInt(8) );
300  setTimId( rset->getInt(9) );
301  setBxtId( rset->getInt(10) );
302  setBttId( rset->getInt(11) );
303  setBstId( rset->getInt(12) );
304 
305  result->setConfigTag( rset->getString(13) );
306  result->setVersion( rset->getInt(14) );
307  result->setDescription( rset->getString(15) );
308  Date dbdate = rset->getDate(16);
309  result->setDBTime( dh.dateToTm( dbdate ));
310 
311  } catch (SQLException &e) {
312  throw(std::runtime_error("FEConfigMainInfo::fetchData(): "+e.getMessage()));
313  }
314 }
void setSpiId(int x)
void setDescription(std::string x)
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setLinId(int x)
void setTimId(int x)
void setBxtId(int x)
void setId(int id)
void setVersion(int id)
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
void setLUTId(int x)
void setFgrId(int x)
void setPedId(int x)
int getId() const
void setWeiId(int x)
void setDBTime(const Tm &x)
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
int getVersion() const
void setConfigTag(std::string x)
Definition: IODConfig.h:31
Statement * m_readStmt
Definition: IODConfig.h:37
std::string getConfigTag()
Definition: IODConfig.h:32
tuple cout
Definition: gather_cfg.py:121
void setSliId(int x)
void setBstId(int x)
void checkConnection() const
Definition: IDBObject.h:41
tuple dh
Definition: cuy.py:353
void setBttId(int x)
int FEConfigMainInfo::fetchID ( )
throw (std::runtime_error
)
private

Definition at line 70 of file FEConfigMainInfo.cc.

References gather_cfg::cout, cuy::dh, and alignCSCRings::e.

72 {
73  // Return from memory if available
74  if (m_ID>0) {
75  return m_ID;
76  }
77 
78  this->checkConnection();
79 
80 
82 
83  std::cout << " tag/version " << getConfigTag() <<"/"<<getVersion() << std::endl;
84 
85  try {
86  Statement* stmt = m_conn->createStatement();
87  if(m_version !=0){
88  stmt->setSQL("SELECT conf_id from FE_CONFIG_MAIN "
89  "WHERE tag = :tag "
90  " and version = :version " );
91  stmt->setString(1, m_config_tag);
92  stmt->setInt(2, m_version);
93  std::cout<<" using query with version " <<endl;
94  } else {
95  // always select the last inserted one with a given tag
96  stmt->setSQL("SELECT conf_id from FE_CONFIG_MAIN "
97  "WHERE tag = :1 and version= (select max(version) from FE_CONFIG_MAIN where tag=:2) " );
98  stmt->setString(1, m_config_tag);
99  stmt->setString(2, m_config_tag);
100  std::cout<<" using query WITHOUT version " <<endl;
101  }
102 
103  ResultSet* rset = stmt->executeQuery();
104 
105  if (rset->next()) {
106  m_ID = rset->getInt(1);
107  } else {
108  m_ID = 0;
109  }
110  std::cout<<m_ID<<endl;
111  m_conn->terminateStatement(stmt);
112  } catch (SQLException &e) {
113  throw(std::runtime_error("FEConfigMainInfo::fetchID: "+e.getMessage()));
114  }
115  setByID(m_ID);
116  return m_ID;
117 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
std::string m_config_tag
Definition: IODConfig.h:27
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
int getVersion() const
std::string getConfigTag()
Definition: IODConfig.h:32
tuple cout
Definition: gather_cfg.py:121
void checkConnection() const
Definition: IDBObject.h:41
tuple dh
Definition: cuy.py:353
void setByID(int id)
int FEConfigMainInfo::fetchIDLast ( )
throw (std::runtime_error
)
private

Definition at line 190 of file FEConfigMainInfo.cc.

References cuy::dh, and alignCSCRings::e.

192 {
193 
194  this->checkConnection();
195 
197 
198  try {
199  Statement* stmt = m_conn->createStatement();
200  stmt->setSQL("SELECT max(conf_id) FROM fe_config_main ");
201  ResultSet* rset = stmt->executeQuery();
202 
203  if (rset->next()) {
204  m_ID = rset->getInt(1);
205  } else {
206  m_ID = 0;
207  }
208  m_conn->terminateStatement(stmt);
209  } catch (SQLException &e) {
210  throw(std::runtime_error("ODRunConfigInfo::fetchIDLast: "+e.getMessage()));
211  }
212 
213  setByID(m_ID);
214  return m_ID;
215 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
void checkConnection() const
Definition: IDBObject.h:41
tuple dh
Definition: cuy.py:353
void setByID(int id)
int FEConfigMainInfo::fetchNextId ( )
throw (std::runtime_error
)
private

Definition at line 49 of file FEConfigMainInfo.cc.

References alignCSCRings::e, and query::result.

49  {
50 
51  int result=0;
52  try {
53  this->checkConnection();
54 
55  m_readStmt = m_conn->createStatement();
56  m_readStmt->setSQL("select fe_config_main_sq.NextVal from dual");
57  ResultSet* rset = m_readStmt->executeQuery();
58  while (rset->next ()){
59  result= rset->getInt(1);
60  }
61  m_conn->terminateStatement(m_readStmt);
62  return result;
63 
64  } catch (SQLException &e) {
65  throw(std::runtime_error("FEConfigMainInfo::fetchNextId(): "+e.getMessage()));
66  }
67 
68 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
tuple result
Definition: query.py:137
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
Statement * m_readStmt
Definition: IODConfig.h:37
void checkConnection() const
Definition: IDBObject.h:41
int FEConfigMainInfo::getBstId ( ) const
inline

Definition at line 70 of file FEConfigMainInfo.h.

References m_bst_id.

Referenced by EcalTPGParamBuilder::analyze(), and popcon::EcalTPGBadStripHandler::getNewObjects().

70 {return m_bst_id; }
int FEConfigMainInfo::getBttId ( ) const
inline

Definition at line 67 of file FEConfigMainInfo.h.

References m_btt_id.

Referenced by EcalTPGParamBuilder::analyze(), and popcon::EcalTPGBadTTHandler::getNewObjects().

67 {return m_btt_id; }
int FEConfigMainInfo::getBxtId ( ) const
inline

Definition at line 64 of file FEConfigMainInfo.h.

References m_bxt_id.

Referenced by EcalTPGParamBuilder::analyze(), and popcon::EcalTPGBadXTHandler::getNewObjects().

64 {return m_bxt_id; }
Tm FEConfigMainInfo::getDBTime ( ) const
inline

Definition at line 32 of file FEConfigMainInfo.h.

References m_db_time.

32 { return m_db_time;}
std::string FEConfigMainInfo::getDescription ( ) const
inline

Definition at line 37 of file FEConfigMainInfo.h.

References m_description.

37 { return m_description;}
std::string m_description
int FEConfigMainInfo::getFgrId ( ) const
inline
int FEConfigMainInfo::getId ( ) const
inline

Definition at line 30 of file FEConfigMainInfo.h.

References m_ID.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

30 { return m_ID; }
int FEConfigMainInfo::getLinId ( ) const
inline
int FEConfigMainInfo::getLUTId ( ) const
inline
int FEConfigMainInfo::getPedId ( ) const
inline
int FEConfigMainInfo::getSliId ( ) const
inline
int FEConfigMainInfo::getSpiId ( ) const
inline
std::string FEConfigMainInfo::getTable ( )
inlinevirtual

Implements IODConfig.

Definition at line 26 of file FEConfigMainInfo.h.

26 { return "FE_CONFIG_MAIN"; }
int FEConfigMainInfo::getTimId ( ) const
inline

Definition at line 61 of file FEConfigMainInfo.h.

References m_tim_id.

Referenced by EcalTPGParamBuilder::analyze().

61 { return m_tim_id;}
int FEConfigMainInfo::getVersion ( ) const
inline

Definition at line 73 of file FEConfigMainInfo.h.

References m_version.

Referenced by popcon::EcalTPGBadXTHandler::getNewObjects().

73 { return m_version; }
int FEConfigMainInfo::getWeiId ( ) const
inline
void FEConfigMainInfo::insertConfig ( )
throw (std::runtime_error
)
private

Definition at line 316 of file FEConfigMainInfo.cc.

References alignCSCRings::e.

318 {
319  try {
320 
321  prepareWrite();
322  writeDB();
323  m_conn->commit();
325  } catch (std::runtime_error &e) {
326  m_conn->rollback();
327  throw(e);
328  } catch (...) {
329  m_conn->rollback();
330  throw(std::runtime_error("FEConfigMainInfo::insertConfig: Unknown exception caught"));
331  }
332 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void terminateWriteStatement()
Definition: IODConfig.h:47
bool FEConfigMainInfo::operator!= ( const FEConfigMainInfo r) const
inline

Definition at line 79 of file FEConfigMainInfo.h.

References alignCSCRings::r.

79 { return !(*this == r); }
bool FEConfigMainInfo::operator== ( const FEConfigMainInfo r) const
inline

Definition at line 78 of file FEConfigMainInfo.h.

References m_ID.

78 { return (m_ID == r.m_ID ); }
void FEConfigMainInfo::prepareWrite ( )
throw (std::runtime_error
)
privatevirtual

Implements IODConfig.

Definition at line 122 of file FEConfigMainInfo.cc.

References alignCSCRings::e.

124 {
125  this->checkConnection();
126 
127 
128  int next_id=fetchNextId();
129 
130  try {
131  m_writeStmt = m_conn->createStatement();
132  m_writeStmt->setSQL("INSERT INTO fe_config_main (conf_id, ped_conf_id, lin_conf_id, lut_conf_id, fgr_conf_id, sli_conf_id, wei_conf_id, spi_conf_id, tim_conf_id, bxt_conf_id, btt_conf_id, bst_conf_id, tag, version, description) "
133  " VALUES (:1, :2, :3 , :4, :5, :6 ,:7, :8, :9, :10, :11, :12, :13, :14, :15 )");
134 
135  m_writeStmt->setInt(1, next_id);
136  m_ID=next_id;
137 
138  } catch (SQLException &e) {
139  throw(std::runtime_error("FEConfigMainInfo::prepareWrite(): "+e.getMessage()));
140  }
141 
142 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Statement * m_writeStmt
Definition: IODConfig.h:36
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
void checkConnection() const
Definition: IDBObject.h:41
void FEConfigMainInfo::setBstId ( int  x)
inline

Definition at line 69 of file FEConfigMainInfo.h.

References m_bst_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

69 { m_bst_id = x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setBttId ( int  x)
inline

Definition at line 66 of file FEConfigMainInfo.h.

References m_btt_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

66 { m_btt_id = x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setBxtId ( int  x)
inline

Definition at line 63 of file FEConfigMainInfo.h.

References m_bxt_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

63 { m_bxt_id = x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setByID ( int  id)
throw (std::runtime_error
)
private

Definition at line 218 of file FEConfigMainInfo.cc.

References gather_cfg::cout, DateHandler::dateToTm(), cuy::dh, and alignCSCRings::e.

220 {
221  this->checkConnection();
222 
224 
225  cout<< "FEConfigMainInfo::setByID called for id "<<id<<endl;
226 
227  try {
228  Statement* stmt = m_conn->createStatement();
229 
230  stmt->setSQL("SELECT * FROM FE_CONFIG_MAIN WHERE conf_id = :1 ");
231  stmt->setInt(1, id);
232 
233  ResultSet* rset = stmt->executeQuery();
234  if (rset->next()) {
235  setId( rset->getInt(1) );
236  setPedId( rset->getInt(2) );
237  setLinId( rset->getInt(3) );
238  setLUTId( rset->getInt(4) );
239  setFgrId( rset->getInt(5) );
240  setSliId( rset->getInt(6) );
241  setWeiId( rset->getInt(7) );
242  setSpiId( rset->getInt(8) );
243  setTimId( rset->getInt(9) );
244  setBxtId( rset->getInt(10) );
245  setBttId( rset->getInt(11) );
246  setBstId( rset->getInt(12) );
247  setConfigTag( rset->getString(13) );
248  setVersion( rset->getInt(14) );
249  setDescription( rset->getString(15) );
250  Date dbdate = rset->getDate(16);
251  setDBTime( dh.dateToTm( dbdate ));
252  m_ID = id;
253  } else {
254  throw(std::runtime_error("FEConfigMainInfo::setByID: Given cycle_id is not in the database"));
255  }
256  m_conn->terminateStatement(stmt);
257  } catch (SQLException &e) {
258  throw(std::runtime_error("FEConfigMainInfo::setByID: "+e.getMessage()));
259  }
260 }
void setSpiId(int x)
void setDescription(std::string x)
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setLinId(int x)
void setTimId(int x)
void setBxtId(int x)
void setId(int id)
void setVersion(int id)
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
void setLUTId(int x)
void setFgrId(int x)
void setPedId(int x)
void setWeiId(int x)
oracle::occi::Statement Statement
Definition: IODConfig.h:23
void setDBTime(const Tm &x)
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
void setConfigTag(std::string x)
Definition: IODConfig.h:31
tuple cout
Definition: gather_cfg.py:121
void setSliId(int x)
void setBstId(int x)
void checkConnection() const
Definition: IDBObject.h:41
tuple dh
Definition: cuy.py:353
void setBttId(int x)
void FEConfigMainInfo::setDBTime ( const Tm x)
inline

Definition at line 33 of file FEConfigMainInfo.h.

References m_db_time, and x.

33 { m_db_time=x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setDescription ( std::string  x)
inline

Definition at line 36 of file FEConfigMainInfo.h.

References m_description, and x.

36 { m_description = x;}
std::string m_description
Definition: DDAxes.h:10
void FEConfigMainInfo::setFgrId ( int  x)
inline

Definition at line 48 of file FEConfigMainInfo.h.

References m_fgr_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

48 { m_fgr_id = x;}
Definition: DDAxes.h:10
void FEConfigMainInfo::setId ( int  id)
inline

Definition at line 29 of file FEConfigMainInfo.h.

References m_ID.

29 { m_ID = id; }
void FEConfigMainInfo::setLinId ( int  x)
inline

Definition at line 42 of file FEConfigMainInfo.h.

References m_lin_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

42 { m_lin_id = x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setLUTId ( int  x)
inline

Definition at line 45 of file FEConfigMainInfo.h.

References m_lut_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

45 { m_lut_id = x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setPedId ( int  x)
inline

Definition at line 39 of file FEConfigMainInfo.h.

References m_ped_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

39 { m_ped_id = x;}
Definition: DDAxes.h:10
void FEConfigMainInfo::setSliId ( int  x)
inline

Definition at line 51 of file FEConfigMainInfo.h.

References m_sli_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

51 { m_sli_id = x; }
Definition: DDAxes.h:10
void FEConfigMainInfo::setSpiId ( int  x)
inline

Definition at line 57 of file FEConfigMainInfo.h.

References m_spi_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

57 { m_spi_id = x;}
Definition: DDAxes.h:10
void FEConfigMainInfo::setTimId ( int  x)
inline

Definition at line 60 of file FEConfigMainInfo.h.

References m_tim_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

60 { m_tim_id = x;}
Definition: DDAxes.h:10
void FEConfigMainInfo::setVersion ( int  id)
inline
void FEConfigMainInfo::setWeiId ( int  x)
inline

Definition at line 54 of file FEConfigMainInfo.h.

References m_wei_id, and x.

Referenced by EcalTPGDBApp::writeToConfDB_TPGMain().

54 { m_wei_id = x;}
Definition: DDAxes.h:10
void FEConfigMainInfo::writeDB ( )
throw (std::runtime_error
)
private

Definition at line 145 of file FEConfigMainInfo.cc.

References gather_cfg::cout, cuy::dh, and alignCSCRings::e.

147 {
148  this->checkConnection();
149  this->checkPrepare();
150 
151  // Validate the data, use infinity-till convention
153 
154  try {
155 
156 
157  m_writeStmt->setInt(2, this->getPedId());
158  m_writeStmt->setInt(3, this->getLinId());
159  m_writeStmt->setInt(4, this->getLUTId());
160  m_writeStmt->setInt(5, this->getFgrId());
161  m_writeStmt->setInt(6, this->getSliId());
162  m_writeStmt->setInt(7, this->getWeiId());
163  m_writeStmt->setInt(8, this->getSpiId());
164  m_writeStmt->setInt(9, this->getTimId());
165  m_writeStmt->setInt(10, this->getBxtId());
166  m_writeStmt->setInt(11, this->getBttId());
167  m_writeStmt->setInt(12, this->getBstId());
168  m_writeStmt->setString(13, this->getConfigTag());
169  m_writeStmt->setInt(14, this->getVersion());
170  m_writeStmt->setString(15, this->getDescription());
171  m_writeStmt->executeUpdate();
172 
173 
174  } catch (SQLException &e) {
175  throw(std::runtime_error("FEConfigMainInfo::writeDB: "+e.getMessage()));
176  }
177  // Now get the ID
178  if (!this->fetchID()) {
179  throw(std::runtime_error("FEConfigMainInfo::writeDB: Failed to write"));
180  }
181  setByID(m_ID);
182 
183  cout<< "FEConfigMainInfo::writeDB>> done inserting FEConfigMainInfo with id="<<m_ID<<endl;
184 
185 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
std::string getDescription() const
Statement * m_writeStmt
Definition: IODConfig.h:36
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
int getTimId() const
int getLinId() const
int getSpiId() const
int getWeiId() const
int getFgrId() const
int getBttId() const
void checkPrepare()
Definition: IODConfig.h:39
int getVersion() const
int getPedId() const
int getBxtId() const
int getBstId() const
std::string getConfigTag()
Definition: IODConfig.h:32
tuple cout
Definition: gather_cfg.py:121
int getLUTId() const
void checkConnection() const
Definition: IDBObject.h:41
int getSliId() const
tuple dh
Definition: cuy.py:353
void setByID(int id)

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 21 of file FEConfigMainInfo.h.

Member Data Documentation

int FEConfigMainInfo::m_bst_id
private

Definition at line 92 of file FEConfigMainInfo.h.

Referenced by getBstId(), and setBstId().

int FEConfigMainInfo::m_btt_id
private

Definition at line 91 of file FEConfigMainInfo.h.

Referenced by getBttId(), and setBttId().

int FEConfigMainInfo::m_bxt_id
private

Definition at line 90 of file FEConfigMainInfo.h.

Referenced by getBxtId(), and setBxtId().

Tm FEConfigMainInfo::m_db_time
private

Definition at line 96 of file FEConfigMainInfo.h.

Referenced by getDBTime(), and setDBTime().

std::string FEConfigMainInfo::m_description
private

Definition at line 97 of file FEConfigMainInfo.h.

Referenced by getDescription(), and setDescription().

int FEConfigMainInfo::m_fgr_id
private

Definition at line 88 of file FEConfigMainInfo.h.

Referenced by getFgrId(), and setFgrId().

int FEConfigMainInfo::m_ID
private

Definition at line 83 of file FEConfigMainInfo.h.

Referenced by getId(), operator==(), and setId().

int FEConfigMainInfo::m_lin_id
private

Definition at line 85 of file FEConfigMainInfo.h.

Referenced by getLinId(), and setLinId().

int FEConfigMainInfo::m_lut_id
private

Definition at line 86 of file FEConfigMainInfo.h.

Referenced by getLUTId(), and setLUTId().

int FEConfigMainInfo::m_ped_id
private

Definition at line 84 of file FEConfigMainInfo.h.

Referenced by getPedId(), and setPedId().

int FEConfigMainInfo::m_sli_id
private

Definition at line 87 of file FEConfigMainInfo.h.

Referenced by getSliId(), and setSliId().

int FEConfigMainInfo::m_spi_id
private

Definition at line 94 of file FEConfigMainInfo.h.

Referenced by getSpiId(), and setSpiId().

int FEConfigMainInfo::m_tim_id
private

Definition at line 93 of file FEConfigMainInfo.h.

Referenced by getTimId(), and setTimId().

int FEConfigMainInfo::m_version
private

Definition at line 95 of file FEConfigMainInfo.h.

Referenced by getVersion(), and setVersion().

int FEConfigMainInfo::m_wei_id
private

Definition at line 89 of file FEConfigMainInfo.h.

Referenced by getWeiId(), and setWeiId().