BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
rdbModel::Table Class Reference

#include <Table.h>

Public Member Functions

 Table ()
 ~Table ()
void setConnection (Connection *connect)
const std::string & getName () const
ColumngetColumnByName (const std::string &name) const
IndexgetIndexByName (const std::string &name) const
AssertiongetAssertionByName (const std::string &name) const
int insertLatest (Row &row, int *serial=0) const
int insertRow (Row &row, int *serial=0) const
int supersedeRow (Row &row, int oldKey, int *newKey=0) const
int updateRows (Row &row, Assertion *where) const
InsertNewgetInsertNew () const
SupersedegetSupersede () const
Visitor::VisitorState accept (Visitor *v)
void sortColumns ()
 Table ()
 ~Table ()
void setConnection (Connection *connect)
const std::string & getName () const
ColumngetColumnByName (const std::string &name) const
IndexgetIndexByName (const std::string &name) const
AssertiongetAssertionByName (const std::string &name) const
int insertLatest (Row &row, int *serial=0) const
int insertRow (Row &row, int *serial=0) const
int supersedeRow (Row &row, int oldKey, int *newKey=0) const
int updateRows (Row &row, Assertion *where) const
InsertNewgetInsertNew () const
SupersedegetSupersede () const
Visitor::VisitorState accept (Visitor *v)
void sortColumns ()
 Table ()
 ~Table ()
void setConnection (Connection *connect)
const std::string & getName () const
ColumngetColumnByName (const std::string &name) const
IndexgetIndexByName (const std::string &name) const
AssertiongetAssertionByName (const std::string &name) const
int insertLatest (Row &row, int *serial=0) const
int insertRow (Row &row, int *serial=0) const
int supersedeRow (Row &row, int oldKey, int *newKey=0) const
int updateRows (Row &row, Assertion *where) const
InsertNewgetInsertNew () const
SupersedegetSupersede () const
Visitor::VisitorState accept (Visitor *v)
void sortColumns ()

Friends

class rdbModel::XercesBuilder
class rdbModel::Rdb

Detailed Description

rdbModel representation of a(n SQL-like) table description

Definition at line 34 of file Calibration/rdbModel/include/rdbModel/Tables/Table.h.

Constructor & Destructor Documentation

◆ Table() [1/3]

rdbModel::Table::Table ( )

Definition at line 21 of file Table.cxx.

22 : m_primaryKeyCol( "" )
23 , m_sorted( false )
24 , m_nEndUser( 0 )
25 , m_validRow( 0 )
26 , m_iNew( 0 )
27 , m_sup( 0 )
28 , m_connect( 0 ) {
29 m_sortedCols.clear();
30 m_programCols.clear();
31 m_userCols.clear();
32 m_mayDefault.clear();
33 m_out = &std::cout;
34 m_err = &std::cerr;
35 }

◆ ~Table() [1/3]

rdbModel::Table::~Table ( )

Definition at line 37 of file Table.cxx.

37 {
38 while ( m_cols.size() )
39 {
40 Column* c = m_cols.back();
41 m_cols.pop_back();
42 delete c;
43 }
44
45 while ( m_asserts.size() )
46 {
47 Assertion* a = m_asserts.back();
48 m_asserts.pop_back();
49 delete a;
50 }
51
52 while ( m_indices.size() )
53 {
54 Index* i = m_indices.back();
55 m_indices.pop_back();
56 delete i;
57 }
58 }
Index
Definition EvtCyclic3.hh:19

◆ Table() [2/3]

rdbModel::Table::Table ( )

◆ ~Table() [2/3]

rdbModel::Table::~Table ( )

◆ Table() [3/3]

rdbModel::Table::Table ( )

◆ ~Table() [3/3]

rdbModel::Table::~Table ( )

Member Function Documentation

◆ accept() [1/3]

Visitor::VisitorState rdbModel::Table::accept ( Visitor * v)

Definition at line 117 of file Table.cxx.

117 {
118
119 Visitor::VisitorState state = v->visitTable( this );
120 if ( state == Visitor::VBRANCHDONE ) return Visitor::VCONTINUE;
121 if ( state != Visitor::VCONTINUE ) return state;
122
123 unsigned n = m_cols.size();
124
125 for ( unsigned i = 0; i < n; i++ )
126 {
127 state = m_cols[i]->accept( v );
128 if ( state != Visitor::VCONTINUE ) return state;
129 }
130
131 n = m_indices.size();
132 for ( unsigned i = 0; i < n; i++ )
133 {
134 state = m_indices[i]->accept( v );
135 if ( state != Visitor::VCONTINUE ) return state;
136 }
137
138 n = m_asserts.size();
139 for ( unsigned i = 0; i < n; i++ )
140 {
141 state = m_asserts[i]->accept( v );
142 if ( state != Visitor::VCONTINUE ) return state;
143 }
144 return state;
145 }
const Int_t n
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35

◆ accept() [2/3]

Visitor::VisitorState rdbModel::Table::accept ( Visitor * v)

◆ accept() [3/3]

Visitor::VisitorState rdbModel::Table::accept ( Visitor * v)

◆ getAssertionByName() [1/3]

Assertion * rdbModel::Table::getAssertionByName ( const std::string & name) const

Definition at line 106 of file Table.cxx.

106 {
107 unsigned nAssert = m_asserts.size();
108 for ( unsigned i = 0; i < nAssert; i++ )
109 {
110 Assertion* a = m_asserts[i];
111 if ( a->getName() == name ) return a;
112 }
113 return 0;
114 }

◆ getAssertionByName() [2/3]

Assertion * rdbModel::Table::getAssertionByName ( const std::string & name) const

◆ getAssertionByName() [3/3]

Assertion * rdbModel::Table::getAssertionByName ( const std::string & name) const

◆ getColumnByName() [1/3]

Column * rdbModel::Table::getColumnByName ( const std::string & name) const

Definition at line 67 of file Table.cxx.

67 {
68 unsigned nCol = m_sortedCols.size();
69 unsigned minI = 0;
70 unsigned maxI = nCol;
71
72 unsigned guess = maxI / 2;
73 unsigned oldGuess = nCol;
74
75 int cmp = name.compare( m_sortedCols[guess]->getName() );
76
77 while ( cmp != 0 )
78 {
79 if ( guess == oldGuess ) return 0; // not found
80
81 if ( cmp < 0 )
82 { // thing we tried is > colName, so decrease maxI
83 maxI = guess;
84 }
85 else
86 { // thing we tried is > colName, so increase minI
87 minI = guess;
88 }
89 oldGuess = guess;
90 guess = ( minI + maxI ) / 2;
91 cmp = name.compare( m_sortedCols[guess]->getName() );
92 }
93 return m_sortedCols[guess];
94 }

Referenced by calibUtil::Metadata::checkNulls(), calibUtil::Metadata::checkValues(), rdbModel::Rdb::getColumn(), supersedeRow(), and rdbModel::Assertion::Operator::validCompareOp().

◆ getColumnByName() [2/3]

Column * rdbModel::Table::getColumnByName ( const std::string & name) const

◆ getColumnByName() [3/3]

Column * rdbModel::Table::getColumnByName ( const std::string & name) const

◆ getIndexByName() [1/3]

Index * rdbModel::Table::getIndexByName ( const std::string & name) const

Definition at line 96 of file Table.cxx.

96 {
97 unsigned nIx = m_indices.size();
98 for ( unsigned iIx = 0; iIx < nIx; iIx++ )
99 {
100 Index* index = m_indices[iIx];
101 if ( index->getName() == name ) return index;
102 }
103 return 0;
104 }

Referenced by rdbModel::Rdb::getIndex().

◆ getIndexByName() [2/3]

Index * rdbModel::Table::getIndexByName ( const std::string & name) const

◆ getIndexByName() [3/3]

Index * rdbModel::Table::getIndexByName ( const std::string & name) const

◆ getInsertNew() [1/3]

InsertNew * rdbModel::Table::getInsertNew ( ) const
inline

Definition at line 88 of file Calibration/rdbModel/include/rdbModel/Tables/Table.h.

88{ return m_iNew; }

◆ getInsertNew() [2/3]

InsertNew * rdbModel::Table::getInsertNew ( ) const
inline

Definition at line 88 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Table.h.

88{ return m_iNew; }

◆ getInsertNew() [3/3]

InsertNew * rdbModel::Table::getInsertNew ( ) const
inline

Definition at line 88 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Table.h.

88{ return m_iNew; }

◆ getName() [1/3]

const std::string & rdbModel::Table::getName ( ) const
inline

◆ getName() [2/3]

const std::string & rdbModel::Table::getName ( ) const
inline

Definition at line 41 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Table.h.

41{ return m_name; }

◆ getName() [3/3]

const std::string & rdbModel::Table::getName ( ) const
inline

Definition at line 41 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Table.h.

41{ return m_name; }

◆ getSupersede() [1/3]

Supersede * rdbModel::Table::getSupersede ( ) const
inline

Definition at line 89 of file Calibration/rdbModel/include/rdbModel/Tables/Table.h.

89{ return m_sup; }

◆ getSupersede() [2/3]

Supersede * rdbModel::Table::getSupersede ( ) const
inline

Definition at line 89 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Table.h.

89{ return m_sup; }

◆ getSupersede() [3/3]

Supersede * rdbModel::Table::getSupersede ( ) const
inline

Definition at line 89 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Table.h.

89{ return m_sup; }

◆ insertLatest() [1/3]

int rdbModel::Table::insertLatest ( Row & row,
int * serial = 0 ) const

insertLatest is smart in the following respects: o Makes some checks to see if row is self-consistent o Fills in all fields which are to be supplied by "service" o If row satisfies conditions for being "official"

  • queries table to see if any pre-existing rows need adjustment; if so, they are adjusted o Finally inserts the row

If test is true, just output description of what would be done without actually doing it. Note row may be modified by the function. If a non-zero pointer is supplied for serial it will contain the primary key value (if there is one) of the new row on exit.

Definition at line 173 of file Table.cxx.

173 {
174
175 if ( !m_connect ) { throw RdbException( "Table::insertLatest Need matching connection" ); }
176 row.rowSort();
177
178 // Fill in columns in m_programCols list
179 fillProgramCols( row, true );
180
181 // Check that all required columns are there and not null
182 for ( unsigned i = 0; i < m_userCols.size(); i++ )
183 {
184 FieldVal* f = row.find( m_userCols[i]->getName() );
185 if ( ( !f ) || ( f->m_null ) )
186 {
187 std::string msg( "Table::insertLatest Row to be inserted missing req'd field " );
188 msg = msg + m_userCols[i]->getName();
189 throw RdbException( msg );
190 }
191 }
192 // Fill in defaults
193 fillDefaults( row );
194
195 // Check against consistency conditions specified by <insertNew>
196 const Assertion* cond = m_iNew->getInternal();
197 bool satisfied;
198
199 try
200 { satisfied = cond->verify( row, row ); } catch ( RdbException ex )
201 {
202 ( *m_out ) << ex.getMsg() << std::endl;
203 return -1;
204 }
205
206 if ( !satisfied ) return -1; // or maybe throw exception here?
207
208 // Check against official conditions specified by <insertNew>
209 const Assertion* condO = m_iNew->getOfficial();
210 Row empty;
211 std::vector<std::string> colNames;
212 std::vector<std::string> colValues;
213 std::vector<std::string> nullCols;
214
215 row.regroup( colNames, colValues, nullCols );
216
217 satisfied = condO->verify( empty, row );
218
219 // If not official, do insert and exit
220 if ( !satisfied )
221 {
222 bool ok = m_connect->insertRow( m_name, colNames, colValues, serial, &nullCols );
223 return ( ok ) ? 0 : -1;
224 }
225
226 const std::vector<InterRow*>& inter = m_iNew->getInterRow();
227
228 unsigned nInter = inter.size();
229 Assertion* subsAssert;
230 for ( unsigned iInter = 0; iInter < nInter; iInter++ )
231 {
232 const Query* q = inter[iInter]->getQuery();
233 const std::vector<std::string>& toSelect = q->getToSelect();
234
235 // Need to make a new Assertion which substitues our proposed row
236 // values for all "toBe" entries
237 subsAssert = new Assertion( q->getAssertion(), &row );
238
239 std::vector<std::string> orderCols;
240 orderCols.clear();
241 ResultHandle* r = m_connect->select( m_name, toSelect, orderCols, subsAssert );
242
243 if ( r->getNRows() == 0 )
244 { // no conflicts found
245 delete subsAssert;
246 continue; // go on to next InterRow, if any.
247 }
248
249 // otherwise
250 // if quit go ahead and quit
251 if ( inter[iInter]->getQuit() )
252 {
253 delete subsAssert;
254 ( *m_out ) << "insert latest not done because of irreconcilable " << std::endl
255 << "conflict with existing rows" << std::endl;
256 return -1;
257 }
258 // else modify conflicting rows as specified in <interRow>.
259 // (i.e., do an update with where clause = subsAssert
260
261 std::vector<Set> sets = inter[iInter]->getSets();
262
263 bool iu = doInterUpdate( sets, subsAssert, row );
264 if ( !iu ) return -1;
265 }
266 // Insert and exit
267 bool ok = m_connect->insertRow( m_name, colNames, colValues, serial, &nullCols );
268 return ( ok ) ? 0 : -1;
269 }
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition KKsem.h:33

◆ insertLatest() [2/3]

int rdbModel::Table::insertLatest ( Row & row,
int * serial = 0 ) const

insertLatest is smart in the following respects: o Makes some checks to see if row is self-consistent o Fills in all fields which are to be supplied by "service" o If row satisfies conditions for being "official"

  • queries table to see if any pre-existing rows need adjustment; if so, they are adjusted o Finally inserts the row

If test is true, just output description of what would be done without actually doing it. Note row may be modified by the function. If a non-zero pointer is supplied for serial it will contain the primary key value (if there is one) of the new row on exit.

◆ insertLatest() [3/3]

int rdbModel::Table::insertLatest ( Row & row,
int * serial = 0 ) const

insertLatest is smart in the following respects: o Makes some checks to see if row is self-consistent o Fills in all fields which are to be supplied by "service" o If row satisfies conditions for being "official"

  • queries table to see if any pre-existing rows need adjustment; if so, they are adjusted o Finally inserts the row

If test is true, just output description of what would be done without actually doing it. Note row may be modified by the function. If a non-zero pointer is supplied for serial it will contain the primary key value (if there is one) of the new row on exit.

◆ insertRow() [1/3]

int rdbModel::Table::insertRow ( Row & row,
int * serial = 0 ) const

The less smart insertRow function fills in all fields which are to be supplied by "service" and inserts the row, without any further checks. Good return value is 0

Definition at line 271 of file Table.cxx.

271 {
272
273 if ( !m_connect ) { throw RdbException( "Table::insertRow Need matching connection" ); }
274 row.rowSort();
275
276 // Fill in columns in m_programCols list
277 fillProgramCols( row, true );
278
279 // Check that all required columns are there and not null
280 for ( unsigned i = 0; i < m_userCols.size(); i++ )
281 {
282 FieldVal* f = row.find( m_userCols[i]->getName() );
283 if ( ( !f ) || ( f->m_null ) )
284 {
285 std::string msg( "Table::insertRow Row to be inserted missing req'd field " );
286 msg = msg + m_userCols[i]->getName();
287 throw RdbException( msg );
288 }
289 }
290
291 // Fill in defaults
292 fillDefaults( row );
293
294 // Check standard valid row condition if there is one
295 if ( m_validRow )
296 {
297 bool satisfied;
298 try
299 { satisfied = m_validRow->verify( row, row ); } catch ( RdbException ex )
300 {
301 ( *m_out ) << ex.getMsg() << std::endl;
302 return -1;
303 }
304 if ( !satisfied )
305 {
306 // throw RdbException("Table::insertRow Row to be inserted is not valid");
307 ( *m_out ) << "Table::insertRow Row to be inserted is not valid " << std::endl;
308 m_out->flush();
309 return -1;
310 }
311 }
312 // Insert and exit
313 std::vector<std::string> colNames;
314 std::vector<std::string> colValues;
315 std::vector<std::string> nullCols;
316
317 row.regroup( colNames, colValues, nullCols );
318 bool ok = m_connect->insertRow( m_name, colNames, colValues, serial, &nullCols );
319 return ( ok ) ? 0 : -1;
320 }

Referenced by supersedeRow().

◆ insertRow() [2/3]

int rdbModel::Table::insertRow ( Row & row,
int * serial = 0 ) const

The less smart insertRow function fills in all fields which are to be supplied by "service" and inserts the row, without any further checks. Good return value is 0

◆ insertRow() [3/3]

int rdbModel::Table::insertRow ( Row & row,
int * serial = 0 ) const

The less smart insertRow function fills in all fields which are to be supplied by "service" and inserts the row, without any further checks. Good return value is 0

◆ setConnection() [1/3]

void rdbModel::Table::setConnection ( Connection * connect)

Definition at line 60 of file Table.cxx.

60 {
61 m_connect = connect;
62 m_out = connect->getOut();
63 m_err = connect->getErrOut();
64 }

◆ setConnection() [2/3]

void rdbModel::Table::setConnection ( Connection * connect)

◆ setConnection() [3/3]

void rdbModel::Table::setConnection ( Connection * connect)

◆ sortColumns() [1/3]

void rdbModel::Table::sortColumns ( )

Definition at line 147 of file Table.cxx.

147 {
148 if ( m_sorted ) return;
149 m_sortedCols = m_cols;
150
151 ColCompare cmpObject;
152
153 // Keep around original set so that rdbGUI will display them in
154 // this order
155 std::sort( m_sortedCols.begin(), m_sortedCols.end(), cmpObject );
156 m_sorted = true;
157 }

◆ sortColumns() [2/3]

void rdbModel::Table::sortColumns ( )

◆ sortColumns() [3/3]

void rdbModel::Table::sortColumns ( )

◆ supersedeRow() [1/3]

int rdbModel::Table::supersedeRow ( Row & row,
int oldKey,
int * newKey = 0 ) const

Given some input values and primary key of an existing row, insert a new row which will supersede the old, according to prescription laid down in <supersede> element of the xml description of the dbs. Good return value is 0

Definition at line 322 of file Table.cxx.

322 {
323 std::string oldKeyStr;
324 facilities::Util::itoa( oldKey, oldKeyStr );
325
326 if ( m_primaryKeyCol.size() == 0 )
327 { throw RdbException( "Table::supersedeRow No primary key column!" ); }
328
329 // Confirm that row does not contain any of the fixed or oldForced columns
330 row.rowSort();
331 const std::vector<std::string>& forced = m_sup->getForced();
332 for ( unsigned i = 0; i < forced.size(); i++ )
333 {
334 if ( row.find( forced[i] ) )
335 {
336 // throw RdbException
337 // (std::string("Table::supersedeRow bad column in input row ") +
338 // forced[i]);
339 ( *m_out ) << "Table::supersedeRow bad column in input row '" << forced[i] << "'"
340 << std::endl;
341 m_out->flush();
342 return -1;
343 }
344 }
345 const std::vector<FieldVal>& fixed = m_sup->getFixed();
346 for ( unsigned i = 0; i < fixed.size(); i++ )
347 {
348 if ( row.find( fixed[i].m_colname ) )
349 {
350 // throw RdbException
351 // (std::string("Table::supersedeRow bad column in input row ") +
352 // fixed[i].m_colname);
353 ( *m_out ) << "Table::supersedeRow bad column in input row " << fixed[i].m_colname;
354 m_out->flush();
355 return -1;
356 }
357 }
358
359 // Check that old row is supersedable
360 if ( !isSupersedable( oldKeyStr ) )
361 {
362 *m_out << "Row " << oldKey << " is not supersedable" << std::endl;
363 m_out->flush();
364 return -1;
365 }
366
367 // Fill in fixed fields
368 const std::vector<std::string>& fixedInterp = m_sup->getFixedInterp();
369 for ( unsigned i = 0; i < fixed.size(); i++ )
370 {
371
372 FieldVal fv = fixed[i];
373 if ( fixedInterp[i].size() > 0 )
374 {
375 Column* c = getColumnByName( fixed[i].m_colname );
376 c->interpret( fixedInterp[i], fv.m_val );
377 }
378 row.addField( fv );
379 }
380 row.rowSort();
381
382 // Fetch needed fields from row to be superseded (oldKey)
383 Assertion::Operator* whereOp = new Assertion::Operator(
384 OPTYPEequal, m_primaryKeyCol, oldKeyStr, FIELDTYPEold, FIELDTYPElit );
385 Assertion* where = new Assertion( whereOp );
386
387 std::vector<std::string> noCols;
388 const std::vector<std::string>& fromOld = m_sup->getFromOld();
389 noCols.clear();
390 ResultHandle* results = m_connect->select( m_name, fromOld, noCols, where );
391 // std::vector<std::string> vals;
392 // results->getRow(vals);
393 std::vector<std::string*> vals;
394 results->getRowPtrs( vals );
395 // Merge as needed into our row. First bunch may already be in the row
396 unsigned nDef = m_sup->getOldDefaulted().size();
397 for ( unsigned i = 0; i < nDef; i++ )
398 {
399 if ( !( row.find( fromOld[i] ) ) )
400 {
401 if ( vals[i] == 0 ) { row.addField( FieldVal( fromOld[i], "", true ) ); }
402 else { row.addField( FieldVal( fromOld[i], *vals[i] ) ); }
403 row.rowSort();
404 }
405 }
406 // Remainder definitely have to be merged in
407 for ( unsigned i = nDef; i < fromOld.size(); i++ )
408 {
409 if ( vals[i] == 0 ) { row.addField( FieldVal( fromOld[i], "", true ) ); }
410 else { row.addField( FieldVal( fromOld[i], *vals[i] ) ); }
411 }
412 results->cleanFieldPtrs( vals );
413
414 // Insert the row and update old row
415 int insRet;
416 try
417 { insRet = insertRow( row, serial ); } catch ( RdbException ex )
418 {
419 ( *m_out ) << ex.getMsg() << std::endl;
420 insRet = -1;
421 }
422
423 if ( insRet )
424 { // something went wrong
425 delete where;
426 return insRet;
427 }
428
429 // Do the update of old row
430 const std::vector<Set*>& setOld = m_sup->getSetOld();
431 std::vector<FieldVal> oldFields;
432 oldFields.reserve( setOld.size() );
433 for ( unsigned i = 0; i < setOld.size(); i++ )
434 {
435 std::string src = setOld[i]->getSrcValue();
436 std::string col = setOld[i]->getDestColName();
437 if ( setOld[i]->hasInterp() )
438 {
439 Column* c = getColumnByName( col );
440 c->interpret( setOld[i]->getInterp(), src );
441 }
442 oldFields.push_back( FieldVal( col, src ) );
443 }
444 Row updateArg( oldFields );
445 try
446 {
447 int iUpdated = updateRows( updateArg, where );
448 if ( iUpdated == 1 ) return 0;
449 return -1;
450 } catch ( RdbException uEx )
451 {
452 ( *m_out ) << uEx.getMsg() << std::endl;
453 return -1;
454 }
455 }
static const char * itoa(int val, std::string &outStr)
int insertRow(Row &row, int *serial=0) const
Definition Table.cxx:271
int updateRows(Row &row, Assertion *where) const
Definition Table.cxx:457
Column * getColumnByName(const std::string &name) const
Definition Table.cxx:67

◆ supersedeRow() [2/3]

int rdbModel::Table::supersedeRow ( Row & row,
int oldKey,
int * newKey = 0 ) const

Given some input values and primary key of an existing row, insert a new row which will supersede the old, according to prescription laid down in <supersede> element of the xml description of the dbs. Good return value is 0

◆ supersedeRow() [3/3]

int rdbModel::Table::supersedeRow ( Row & row,
int oldKey,
int * newKey = 0 ) const

Given some input values and primary key of an existing row, insert a new row which will supersede the old, according to prescription laid down in <supersede> element of the xml description of the dbs. Good return value is 0

◆ updateRows() [1/3]

int rdbModel::Table::updateRows ( Row & row,
Assertion * where ) const

Silently fills in "service" fields as well as requested updates Good return value is 0

Definition at line 457 of file Table.cxx.

457 {
458
459 if ( !m_connect ) { throw RdbException( "Table::insertLatest Need matching connection" ); }
460 row.rowSort();
461
462 // Fill in columns in m_programCols list
463 fillProgramCols( row, false );
464
465 std::vector<std::string> colNames;
466 std::vector<std::string> colValues;
467 std::vector<std::string> nullCols;
468
469 row.regroup( colNames, colValues, nullCols );
470
471 return m_connect->update( m_name, colNames, colValues, where, &nullCols );
472 }

Referenced by supersedeRow().

◆ updateRows() [2/3]

int rdbModel::Table::updateRows ( Row & row,
Assertion * where ) const

Silently fills in "service" fields as well as requested updates Good return value is 0

◆ updateRows() [3/3]

int rdbModel::Table::updateRows ( Row & row,
Assertion * where ) const

Silently fills in "service" fields as well as requested updates Good return value is 0

◆ rdbModel::Rdb

◆ rdbModel::XercesBuilder


The documentation for this class was generated from the following files: