CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
LMFUnique Class Reference

#include <LMFUnique.h>

Inheritance diagram for LMFUnique:
IUniqueDBObject IDBObject LMFColor LMFDat LMFIOV LMFLmrSubIOV LMFPrimVers LMFRunIOV LMFRunTag LMFSeqDat LMFTrigType

Public Types

typedef oracle::occi::ResultSet ResultSet
 
typedef oracle::occi::Statement Statement
 

Public Member Functions

void attach (std::string name, LMFUnique *u)
 
void debug ()
 
virtual void dump () const
 
virtual void dump (int n) const
 
virtual bool exists ()
 
virtual boost::ptr_list< LMFUniquefetchAll () const noexcept(false)
 
int fetchID () noexcept(false) override
 
std::string getClassName ()
 
std::string getClassName () const
 
int getID () const
 
int getInt (std::string fieldname) const
 
std::string getString (std::string fieldname) const
 
virtual bool isValid ()
 
virtual bool isValid () const
 
 LMFUnique ()
 
 LMFUnique (EcalDBConnection *c)
 
 LMFUnique (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
void nodebug ()
 
virtual bool operator< (const LMFUnique &r)
 
virtual bool operator<= (const LMFUnique &r)
 
std::string sequencePostfix (const Tm &t)
 
void setByID (int id) noexcept(false) override
 
LMFUniquesetInt (std::string key, int value)
 
LMFUniquesetString (std::string key, std::string value)
 
void startProfiling ()
 
void stopProfiling ()
 
 ~LMFUnique () override
 
- 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 ()
 

Protected Member Functions

virtual void getParameters (ResultSet *rset)
 
virtual void setClassName (std::string s)
 
virtual int writeDB () noexcept(false)
 
virtual int writeForeignKeys () noexcept(false)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 

Protected Attributes

bool _profiling
 
std::string m_className
 
char m_debug
 
std::map< std::string, LMFUnique * > m_foreignKeys
 
std::map< std::string, int > m_intFields
 
std::map< std::string, std::string > m_stringFields
 
- Protected Attributes inherited from IUniqueDBObject
int m_ID
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Private Member Functions

virtual LMFUniquecreateObject () const
 
virtual std::string fetchAllSql (Statement *stmt) const
 
virtual std::string fetchIdSql (Statement *stmt)
 
virtual void fetchParentIDs ()
 
virtual std::string setByIDSql (Statement *stmt, int id)
 
virtual std::string writeDBSql (Statement *stmt)
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Static Public Attributes inherited from IDBObject
static const int ECALDB_NROWS = 1024
 

Detailed Description

Definition at line 17 of file LMFUnique.h.

Member Typedef Documentation

◆ ResultSet

typedef oracle::occi::ResultSet LMFUnique::ResultSet

Definition at line 19 of file LMFUnique.h.

◆ Statement

typedef oracle::occi::Statement LMFUnique::Statement

Definition at line 20 of file LMFUnique.h.

Constructor & Destructor Documentation

◆ LMFUnique() [1/3]

LMFUnique::LMFUnique ( )
inline

Definition at line 23 of file LMFUnique.h.

23  {
24  _profiling = false;
25  m_env = nullptr;
26  m_conn = nullptr;
27  m_ID = 0;
28  setClassName("LMFUnique");
29  nodebug();
30  }

References _profiling, IDBObject::m_conn, IDBObject::m_env, IUniqueDBObject::m_ID, nodebug(), and setClassName().

◆ LMFUnique() [2/3]

LMFUnique::LMFUnique ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)
inline

Definition at line 31 of file LMFUnique.h.

31  {
32  _profiling = false;
33  m_ID = 0;
34  setClassName("LMFUnique");
35  nodebug();
37  }

References _profiling, SiStripCommissioningClient_cfg::conn, web.browse_db::env, IUniqueDBObject::m_ID, nodebug(), setClassName(), and IDBObject::setConnection().

◆ LMFUnique() [3/3]

LMFUnique::LMFUnique ( EcalDBConnection c)
inline

Definition at line 38 of file LMFUnique.h.

38  {
39  _profiling = false;
40  m_ID = 0;
41  setClassName("LMFUnique");
42  nodebug();
43  setConnection(c->getEnv(), c->getConn());
44  }

References _profiling, HltBtagPostValidation_cff::c, IUniqueDBObject::m_ID, nodebug(), setClassName(), and IDBObject::setConnection().

◆ ~LMFUnique()

LMFUnique::~LMFUnique ( )
override

Definition at line 7 of file LMFUnique.cc.

7 {}

Member Function Documentation

◆ attach()

void LMFUnique::attach ( std::string  name,
LMFUnique u 
)

Definition at line 48 of file LMFUnique.cc.

48  {
49  std::map<std::string, LMFUnique*>::const_iterator i = m_foreignKeys.find(name);
50  if (i != m_foreignKeys.end()) {
51  if (i->second != u) {
52  m_foreignKeys[name] = u;
53  m_ID = 0;
54  }
55  } else {
56  m_foreignKeys[name] = u;
57  m_ID = 0;
58  }
59 }

References mps_fire::i, and Skims_PA_cff::name.

Referenced by LMFCorrCoefDatComponent::setLMFLmrSubIOV(), LMFDat::setLMFRunIOV(), and LMFRunIOV::setSequence().

◆ createObject()

LMFUnique * LMFUnique::createObject ( ) const
privatevirtual

Reimplemented in LMFColor, LMFRunTag, LMFIOV, LMFPrimVers, LMFTrigType, LMFCorrVers, and LMFSeqVers.

Definition at line 173 of file LMFUnique.cc.

173  {
174  /* this method should return a pointer to a newly created object */
175  return nullptr;
176 }

◆ debug()

void LMFUnique::debug ( )
inline

Definition at line 70 of file LMFUnique.h.

70 { m_debug = 1; }

References m_debug.

Referenced by LMFCorrCoefDat::fetchBetween(), LMFPnPrimDat::LMFPnPrimDat(), and LMFDat::writeDB().

◆ dump() [1/2]

void LMFUnique::dump ( void  ) const
virtual

Reimplemented in LMFDat, LMFRunIOV, and LMFIOV.

Definition at line 104 of file LMFUnique.cc.

104 { dump(0); }

References FrontierConditions_GlobalTag_cff::dump.

Referenced by LMFRunIOV::dump(), LMFDat::dump(), LMFCorrCoefDat::fetch(), and LMFSeqDat::writeDBSql().

◆ dump() [2/2]

void LMFUnique::dump ( int  n) const
virtual

Reimplemented in LMFDat.

Definition at line 106 of file LMFUnique.cc.

106  {
107  /*
108  This method is used to dump the content of an object
109  Indent data if the object is contained inside another object
110  */
111  std::string m_indent = "";
112  std::string m_trail = "";
113  m_trail.resize(70 - 31 - n * 2, '#');
114  m_indent.resize(n * 2, ' ');
115  m_indent += "|";
116  // start of object
117  cout << m_indent << "#################" << setw(15) << m_className << " " << m_trail << endl;
118  cout << m_indent << "Address: " << this << endl;
119  cout << m_indent << "Connection params : " << m_env << ", " << m_conn << endl;
120  // object ID in the DB
121  cout << m_indent << "ID" << setw(18) << ": " << m_ID;
122  if (m_ID == 0) {
123  cout << " *** NULL ID ***";
124  }
125  if (!isValid()) {
126  cout << " INVALID ***";
127  }
128  cout << endl;
129  // iterate over string fields
130  std::map<std::string, std::string>::const_iterator is = m_stringFields.begin();
131  std::map<std::string, std::string>::const_iterator es = m_stringFields.end();
132  while (is != es) {
133  std::string key = is->first;
134  cout << m_indent << key << setw(20 - key.length()) << ": " << is->second << endl;
135  is++;
136  }
137  // iterate over integer fields
138  std::map<std::string, int>::const_iterator ii = m_intFields.begin();
139  std::map<std::string, int>::const_iterator ei = m_intFields.end();
140  while (ii != ei) {
141  std::string key = ii->first;
142  cout << m_indent << key << setw(20 - key.length()) << ": " << ii->second << endl;
143  ii++;
144  }
145  cout << m_indent << "#################" << setw(15) << m_className << " " << m_trail << endl;
146  // iterate over foreign keys
147  std::map<std::string, LMFUnique*>::const_iterator ik = m_foreignKeys.begin();
148  std::map<std::string, LMFUnique*>::const_iterator ek = m_foreignKeys.end();
149  m_indent.clear();
150  m_indent.resize((n + 1) * 2, ' ');
151  while (ik != ek) {
152  cout << m_indent << "Foreign Key: " << ik->first << endl;
153  ik->second->dump(n + 1);
154  ik++;
155  }
156 }

References gather_cfg::cout, cuy::ii, crabWrapper::key, dqmiodumpmetadata::n, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ exists()

bool LMFUnique::exists ( )
virtual

Definition at line 158 of file LMFUnique.cc.

158  {
159  fetchID();
160  bool ret = false;
161  if (m_ID > 0) {
162  ret = true;
163  }
164  return ret;
165 }

References runTheMatrix::ret.

◆ fetchAll()

boost::ptr_list< LMFUnique > LMFUnique::fetchAll ( ) const
virtualnoexcept

Definition at line 61 of file LMFUnique.cc.

61  {
62  /*
63  Returns a list of pointers to DB objects
64  */
65  boost::ptr_list<LMFUnique> l;
66  this->checkConnection();
67 
68  try {
69  Statement* stmt = m_conn->createStatement();
70  std::string sql = fetchAllSql(stmt);
71  if (!sql.empty()) {
72  if (m_debug) {
73  cout << m_className + ": Query " + sql << endl;
74  }
75  ResultSet* rset = stmt->executeQuery();
76  while (rset->next() != 0) {
78  if (m_debug) {
79  o->debug();
80  }
81  if (o != nullptr) {
82  o->setByID(rset->getInt(1));
83  if (m_debug) {
84  o->dump();
85  }
86  try {
87  l.push_back(o);
88  } catch (boost::bad_pointer& e) {
89  throw(std::runtime_error(m_className + "::fetchAll: " + e.what()));
90  }
91  }
92  }
93  }
94  m_conn->terminateStatement(stmt);
95  } catch (SQLException& e) {
96  throw(std::runtime_error(m_className + "::fetchAll: " + e.getMessage()));
97  }
98  if (m_debug) {
99  cout << m_className << ": list size = " << l.size() << endl;
100  }
101  return l;
102 }

References gather_cfg::cout, createObject(), MillePedeFileConverter_cfg::e, cmsLHEtoEOSManager::l, EcalTangentSkim_cfg::o, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by LMFDefFabric::initialize(), and LMFColor::isValid().

◆ fetchAllSql()

std::string LMFUnique::fetchAllSql ( Statement stmt) const
privatevirtual

Reimplemented in LMFColor, LMFRunTag, LMFPrimVers, LMFTrigType, LMFCorrVers, and LMFSeqVers.

Definition at line 167 of file LMFUnique.cc.

167  {
168  /* this method should setup a Statement to select the unique IDs of the
169  objects to return */
170  return "";
171 }

◆ fetchID()

int LMFUnique::fetchID ( )
overridevirtualnoexcept

Implements IUniqueDBObject.

Definition at line 197 of file LMFUnique.cc.

197  {
198  /*
199  This method fetch the ID of the object from the database according
200  to the given specifications.
201 
202  It is assumed that there is only one object in the database with the
203  given specifications. In case more than one object can be retrieved
204  this method throws an exception.
205 
206  Since not all the specifications can define completely the object
207  itself, at the end, we setup the object based on its ID.
208  */
209  // Return tag from memory if available
210  if (m_ID) {
211  return m_ID;
212  }
213 
214  this->checkConnection();
215 
216  // fetch this ID
217  try {
218  Statement* stmt = m_conn->createStatement();
219  // prepare the sql query
220  std::string sql = fetchIdSql(stmt);
221  if (!sql.empty()) {
222  if (m_debug) {
223  cout << m_className + ": Query " + sql << endl;
224  }
225 
226  ResultSet* rset = stmt->executeQuery();
227  if (rset->next() != 0) {
228  m_ID = rset->getInt(1);
229  } else {
230  m_ID = 0;
231  }
232  if (m_debug) {
233  cout << m_className + ": ID set to " << m_ID << endl;
234  }
235  int n = rset->getNumArrayRows();
236  if (m_debug) {
237  cout << m_className + ": Returned " << n << " rows" << endl;
238  }
239  if (n > 1) {
240  throw(std::runtime_error(m_className + "::fetchID: too many rows returned " + "executing query " + sql));
241  m_ID = 0;
242  }
243  }
244  m_conn->terminateStatement(stmt);
245  } catch (SQLException& e) {
246  throw(std::runtime_error(m_className + "::fetchID: " + e.getMessage()));
247  }
248  // given the ID of this object setup it completely
249  if (m_ID > 0) {
250  setByID(m_ID);
251  }
252  // if foreignKeys are there, set these objects too
253  map<string, LMFUnique*>::iterator i = m_foreignKeys.begin();
254  map<string, LMFUnique*>::iterator e = m_foreignKeys.end();
255  while (i != e) {
256  if (i->second->getID() == 0) {
257  i->second->fetchID();
258  }
259  i++;
260  }
261  if (m_debug) {
262  cout << m_className << ": fetchID:: returning " << m_ID << endl;
263  }
264  return m_ID;
265 }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, mps_fire::i, dqmiodumpmetadata::n, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by LMFDat::getLMFRunIOVID(), LMFColor::setColor(), LMFColor::setName(), and LMFTrigType::setName().

◆ fetchIdSql()

virtual std::string LMFUnique::fetchIdSql ( Statement stmt)
inlineprivatevirtual

Reimplemented in LMFLmrSubIOV, LMFSeqDat, LMFRunIOV, LMFColor, LMFRunTag, LMFIOV, LMFPrimVers, LMFTrigType, LMFCorrVers, and LMFSeqVers.

Definition at line 82 of file LMFUnique.h.

82 { return ""; }

◆ fetchParentIDs()

virtual void LMFUnique::fetchParentIDs ( )
inlineprivatevirtual

Reimplemented in LMFIOV, and LMFSeqDat.

Definition at line 86 of file LMFUnique.h.

86 {}

◆ getClassName() [1/2]

std::string LMFUnique::getClassName ( )
inline

Definition at line 56 of file LMFUnique.h.

56 { return m_className; }

References m_className.

◆ getClassName() [2/2]

std::string LMFUnique::getClassName ( ) const
inline

Definition at line 57 of file LMFUnique.h.

57 { return m_className; }

References m_className.

◆ getID()

int LMFUnique::getID ( ) const
inline

◆ getInt()

int LMFUnique::getInt ( std::string  fieldname) const

◆ getParameters()

virtual void LMFUnique::getParameters ( ResultSet rset)
inlineprotectedvirtual

Reimplemented in LMFLmrSubIOV, LMFSeqDat, LMFRunIOV, LMFColor, LMFRunTag, LMFIOV, LMFPrimVers, LMFTrigType, LMFCorrVers, and LMFSeqVers.

Definition at line 90 of file LMFUnique.h.

90 {}

◆ getString()

std::string LMFUnique::getString ( std::string  fieldname) const

◆ isValid() [1/2]

virtual bool LMFUnique::isValid ( void  )
inlinevirtual

◆ isValid() [2/2]

virtual bool LMFUnique::isValid ( void  ) const
inlinevirtual

Reimplemented in LMFSeqDat.

Definition at line 48 of file LMFUnique.h.

48 { return true; }

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ nodebug()

void LMFUnique::nodebug ( )
inline

Definition at line 71 of file LMFUnique.h.

71 { m_debug = 0; }

References m_debug.

Referenced by LMFUnique().

◆ operator<()

virtual bool LMFUnique::operator< ( const LMFUnique r)
inlinevirtual

Definition at line 75 of file LMFUnique.h.

75 { return (m_ID < r.m_ID); }

References IUniqueDBObject::m_ID, and alignCSCRings::r.

◆ operator<=()

virtual bool LMFUnique::operator<= ( const LMFUnique r)
inlinevirtual

Definition at line 76 of file LMFUnique.h.

76 { return (m_ID <= r.m_ID); }

References IUniqueDBObject::m_ID, and alignCSCRings::r.

◆ sequencePostfix()

std::string LMFUnique::sequencePostfix ( const Tm t)

Definition at line 9 of file LMFUnique.cc.

9  {
10  std::string ts = t.str();
11  return ts.substr(2, 2);
12 }

References AlCaHLTBitMon_QueryRunRegistry::string, and OrderedSet::t.

Referenced by LMFRunIOV::writeDBSql(), LMFSeqDat::writeDBSql(), and LMFLmrSubIOV::writeDBSql().

◆ setByID()

void LMFUnique::setByID ( int  id)
overridevirtualnoexcept

Implements IUniqueDBObject.

Definition at line 267 of file LMFUnique.cc.

267  {
268  /*
269  Given the ID of an object setup it
270  */
271  if (m_debug) {
272  cout << m_className << ": Setting this object as ID = " << id << endl;
273  }
274  this->checkConnection();
275  try {
276  Statement* stmt = m_conn->createStatement();
277  std::string sql = setByIDSql(stmt, id);
278  if (sql.empty()) {
279  throw(std::runtime_error(m_className + "::setByID: [empty sql])"));
280  }
281  if (m_debug) {
282  cout << m_className + ": " + sql << endl;
283  }
284 
285  ResultSet* rset = stmt->executeQuery();
286  if (rset->next() != 0) {
287  // setup the concrete object
288  getParameters(rset);
289  m_ID = id;
290  if (m_debug) {
291  cout << m_className + ": Setting done. ID set to " << m_ID << endl;
292  }
293  } else {
294  throw(std::runtime_error(m_className + "::setByID: Given id is not in the database"));
295  }
296  m_conn->terminateStatement(stmt);
297  } catch (SQLException& e) {
298  throw(std::runtime_error(m_className + "::setByID: " + e.getMessage()));
299  }
300 }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, triggerObjects_cff::id, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by LMFCorrCoefDat::fetch(), LMFRunIOV::fetchBySequence(), LMFRunIOV::getLMFColor(), LMFLmrSubIOV::getLMFIOV(), LMFCorrCoefDatComponent::getLMFLmrSubIOV(), LMFDat::getLMFRunIOV(), LMFRunIOV::getLMFRunTag(), and LMFRunIOV::getSequence().

◆ setByIDSql()

virtual std::string LMFUnique::setByIDSql ( Statement stmt,
int  id 
)
inlineprivatevirtual

Reimplemented in LMFLmrSubIOV, LMFSeqDat, LMFRunIOV, LMFColor, LMFRunTag, LMFIOV, LMFPrimVers, LMFTrigType, LMFCorrVers, and LMFSeqVers.

Definition at line 84 of file LMFUnique.h.

84 { return ""; }

◆ setClassName()

virtual void LMFUnique::setClassName ( std::string  s)
inlineprotectedvirtual

◆ setInt()

LMFUnique & LMFUnique::setInt ( std::string  key,
int  value 
)

Definition at line 31 of file LMFUnique.cc.

31  {
32  // check if this key exists
33  std::map<std::string, int>::const_iterator i = m_intFields.find(key);
34  if (i != m_intFields.end()) {
35  // the key exist: check if it changed: reset the ID of the object
36  if (i->second != value) {
38  m_ID = 0;
39  }
40  } else {
41  // create this key and reset the ID of the object
43  m_ID = 0;
44  }
45  return *this;
46 }

References mps_fire::i, crabWrapper::key, and relativeConstraints::value.

Referenced by LMFDat::getLMFRunIOVID(), LMFRunTag::getParameters(), LMFColor::getParameters(), LMFSeqDat::getParameters(), LMFColor::setColor(), LMFRunIOV::setColor(), LMFRunIOV::setColorIndex(), LMFCorrCoefDatComponent::setLMFLmrSubIOV(), LMFDat::setLMFRunIOV(), LMFRunIOV::setLMFRunTag(), LMFRunIOV::setLmr(), LMFColor::setName(), LMFRunIOV::setSequence(), LMFSeqDat::setSequenceNumber(), LMFRunIOV::setTriggerType(), LMFRunTag::setVersion(), LMFSeqDat::setVmax(), and LMFSeqDat::setVmin().

◆ setString()

LMFUnique & LMFUnique::setString ( std::string  key,
std::string  value 
)

Definition at line 14 of file LMFUnique.cc.

14  {
15  // check if this key exists
16  std::map<std::string, std::string>::const_iterator i = m_stringFields.find(key);
17  if (i != m_stringFields.end()) {
18  // the key exist: check if it changed: reset the ID of the object
19  if (i->second != value) {
21  m_ID = 0;
22  }
23  } else {
24  // create this key and reset the ID of the object
26  m_ID = 0;
27  }
28  return *this;
29 }

References mps_fire::i, crabWrapper::key, and relativeConstraints::value.

Referenced by LMFCorrVers::getParameters(), LMFSeqVers::getParameters(), LMFTrigType::getParameters(), LMFPrimVers::getParameters(), LMFRunTag::getParameters(), LMFColor::getParameters(), LMFSeqDat::getParameters(), LMFCorrVers::LMFCorrVers(), LMFPrimVers::LMFPrimVers(), LMFSeqVers::LMFSeqVers(), LMFColor::setColor(), LMFPrimVers::setDescription(), LMFRunTag::setGeneralTag(), LMFColor::setName(), LMFTrigType::setName(), LMFTrigType::setNames(), LMFSeqDat::setSequenceStart(), LMFSeqDat::setSequenceStop(), LMFRunIOV::setSubRunEnd(), LMFRunIOV::setSubRunStart(), and LMFRunIOV::setSubRunType().

◆ startProfiling()

void LMFUnique::startProfiling ( )
inline

Definition at line 77 of file LMFUnique.h.

77 { _profiling = true; }

References _profiling.

◆ stopProfiling()

void LMFUnique::stopProfiling ( )
inline

Definition at line 78 of file LMFUnique.h.

78 { _profiling = false; }

References _profiling.

◆ writeDB()

int LMFUnique::writeDB ( )
protectedvirtualnoexcept

Reimplemented in LMFDat, LMFColoredTable, and LMFCorrCoefDatComponent.

Definition at line 316 of file LMFUnique.cc.

316  {
317  clock_t start = 0;
318  clock_t end = 0;
319  if (_profiling) {
320  start = clock();
321  }
322  // write the associated objects first (foreign keys must exist before use)
324  // see if this data is already in the DB
325  if (!(this->fetchID())) {
326  // check the connectioin
327  this->checkConnection();
328 
329  // write new tag to the DB
330  std::string sql = "";
331  try {
332  Statement* stmt = m_conn->createStatement();
333 
334  sql = writeDBSql(stmt);
335  if (!sql.empty()) {
336  if (m_debug) {
337  cout << m_className + ": " + sql << endl;
338  }
339  stmt->executeUpdate();
340  }
341  m_conn->commit();
342  m_conn->terminateStatement(stmt);
343  } catch (SQLException& e) {
344  debug();
345  dump();
346  throw(std::runtime_error(m_className + "::writeDB: " + e.getMessage() + " while executing query " + sql));
347  }
348  // now get the id
349  if (this->fetchID() == 0) {
350  throw(std::runtime_error(m_className + "::writeDB: Failed to write"));
351  }
352  }
353  if (_profiling) {
354  end = clock();
355  if (m_debug) {
356  std::cout << m_className << ":: Spent time in writeDB:" << ((double)(end - start)) / CLOCKS_PER_SEC << " s"
357  << endl;
358  }
359  }
360  return m_ID;
361 }

References gather_cfg::cout, debug, FrontierConditions_GlobalTag_cff::dump, MillePedeFileConverter_cfg::e, end, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ writeDBSql()

virtual std::string LMFUnique::writeDBSql ( Statement stmt)
inlineprivatevirtual

Reimplemented in LMFLmrSubIOV, LMFSeqDat, LMFRunIOV, and LMFIOV.

Definition at line 81 of file LMFUnique.h.

81 { return ""; }

◆ writeForeignKeys()

int LMFUnique::writeForeignKeys ( )
protectedvirtualnoexcept

Definition at line 302 of file LMFUnique.cc.

302  {
303  std::map<std::string, LMFUnique*>::const_iterator i = m_foreignKeys.begin();
304  std::map<std::string, LMFUnique*>::const_iterator e = m_foreignKeys.end();
305  int count = 0;
306  while (i != e) {
307  if (i->second->getID() == 0) {
308  i->second->writeDB();
309  count++;
310  }
311  i++;
312  }
313  return count;
314 }

References KineDebug3::count(), MillePedeFileConverter_cfg::e, and mps_fire::i.

Referenced by LMFDat::writeDB().

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 21 of file LMFUnique.h.

Member Data Documentation

◆ _profiling

bool LMFUnique::_profiling
protected

Definition at line 103 of file LMFUnique.h.

Referenced by LMFUnique(), startProfiling(), and stopProfiling().

◆ m_className

std::string LMFUnique::m_className
protected

◆ m_debug

char LMFUnique::m_debug
protected

◆ m_foreignKeys

std::map<std::string, LMFUnique *> LMFUnique::m_foreignKeys
protected

Definition at line 102 of file LMFUnique.h.

Referenced by LMFDat::getLMFRunIOVID(), LMFDat::isValid(), and LMFDat::writeDB().

◆ m_intFields

std::map<std::string, int> LMFUnique::m_intFields
protected

◆ m_stringFields

std::map<std::string, std::string> LMFUnique::m_stringFields
protected
LMFUnique::setClassName
virtual void setClassName(std::string s)
Definition: LMFUnique.h:93
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
LMFUnique::m_foreignKeys
std::map< std::string, LMFUnique * > m_foreignKeys
Definition: LMFUnique.h:102
mps_fire.i
i
Definition: mps_fire.py:355
start
Definition: start.py:1
IUniqueDBObject::m_ID
int m_ID
Definition: IUniqueDBObject.h:18
LMFUnique::setByID
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LMFUnique::writeDBSql
virtual std::string writeDBSql(Statement *stmt)
Definition: LMFUnique.h:81
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LMFUnique::m_className
std::string m_className
Definition: LMFUnique.h:95
LMFUnique::setByIDSql
virtual std::string setByIDSql(Statement *stmt, int id)
Definition: LMFUnique.h:84
LMFUnique::m_debug
char m_debug
Definition: LMFUnique.h:96
end
#define end
Definition: vmac.h:39
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
LMFUnique::writeForeignKeys
virtual int writeForeignKeys() noexcept(false)
Definition: LMFUnique.cc:302
LMFUnique::m_intFields
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:100
alignCSCRings.s
s
Definition: alignCSCRings.py:92
LMFUnique::dump
virtual void dump() const
Definition: LMFUnique.cc:104
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
LMFUnique::createObject
virtual LMFUnique * createObject() const
Definition: LMFUnique.cc:173
LMFUnique::isValid
virtual bool isValid() const
Definition: LMFUnique.h:48
OrderedSet.t
t
Definition: OrderedSet.py:90
LMFUnique::fetchIdSql
virtual std::string fetchIdSql(Statement *stmt)
Definition: LMFUnique.h:82
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
web.browse_db.env
env
Definition: browse_db.py:18
LMFUnique::fetchID
int fetchID() noexcept(false) override
Definition: LMFUnique.cc:197
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
value
Definition: value.py:1
LMFUnique::_profiling
bool _profiling
Definition: LMFUnique.h:103
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
alignCSCRings.r
r
Definition: alignCSCRings.py:93
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
relativeConstraints.value
value
Definition: relativeConstraints.py:53
LMFUnique::Statement
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
LMFUnique::m_stringFields
std::map< std::string, std::string > m_stringFields
Definition: LMFUnique.h:98
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
LMFUnique::debug
void debug()
Definition: LMFUnique.h:70
LMFUnique::getParameters
virtual void getParameters(ResultSet *rset)
Definition: LMFUnique.h:90
LMFUnique::nodebug
void nodebug()
Definition: LMFUnique.h:71
LMFUnique
Definition: LMFUnique.h:17
crabWrapper.key
key
Definition: crabWrapper.py:19
cuy.ii
ii
Definition: cuy.py:590
LMFUnique::fetchAllSql
virtual std::string fetchAllSql(Statement *stmt) const
Definition: LMFUnique.cc:167
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
LMFUnique::ResultSet
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19