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 Attributes
cond::persistency::TAG_MIGRATION::Table Class Reference

#include <IOVSchema.h>

Inheritance diagram for cond::persistency::TAG_MIGRATION::Table:
cond::persistency::ITagMigrationTable

Public Member Functions

void create ()
 
bool exists ()
 
void insert (const std::string &sourceAccount, const std::string &sourceTag, const std::string &tagName, int statusCode, const boost::posix_time::ptime &insertionTime)
 
bool select (const std::string &sourceAccount, const std::string &sourceTag, std::string &tagName, int &statusCode)
 
 Table (coral::ISchema &schema)
 
void updateValidationCode (const std::string &sourceAccount, const std::string &sourceTag, int statusCode)
 
virtual ~Table ()
 
- Public Member Functions inherited from cond::persistency::ITagMigrationTable
virtual ~ITagMigrationTable ()
 

Private Attributes

coral::ISchema & m_schema
 

Detailed Description

Definition at line 147 of file IOVSchema.h.

Constructor & Destructor Documentation

cond::persistency::TAG_MIGRATION::Table::Table ( coral::ISchema &  schema)
explicit

Definition at line 374 of file IOVSchema.cc.

374  :
375  m_schema( schema ){
376  }
virtual cond::persistency::TAG_MIGRATION::Table::~Table ( )
inlinevirtual

Definition at line 150 of file IOVSchema.h.

150 {}

Member Function Documentation

void cond::persistency::TAG_MIGRATION::Table::create ( )
virtual

Implements cond::persistency::ITagMigrationTable.

Definition at line 382 of file IOVSchema.cc.

References cond::persistency::TableDescription< Types >::get(), cond::persistency::TableDescription< Types >::setForeignKey(), cond::persistency::TableDescription< Types >::setPrimaryKey(), cond::persistency::throwException(), and cond::persistency::TAG_MIGRATION::tname.

382  {
383  if( exists() ){
384  throwException( "TAG_MIGRATION table already exists in this schema.",
385  "TAG_MIGRATION::create");
386  }
387  TableDescription< SOURCE_ACCOUNT, SOURCE_TAG, TAG_NAME, STATUS_CODE, INSERTION_TIME > descr( tname );
388  descr.setPrimaryKey<SOURCE_ACCOUNT, SOURCE_TAG>();
389  descr.setForeignKey< TAG_NAME, TAG::NAME >( "TAG_NAME_FK" );
390  createTable( m_schema, descr.get() );
391  }
static char const * tname
Definition: IOVSchema.h:139
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
bool cond::persistency::TAG_MIGRATION::Table::exists ( )
virtual

Implements cond::persistency::ITagMigrationTable.

Definition at line 378 of file IOVSchema.cc.

References cond::persistency::TAG_MIGRATION::tname.

378  {
379  return existsTable( m_schema, tname );
380  }
static char const * tname
Definition: IOVSchema.h:139
void cond::persistency::TAG_MIGRATION::Table::insert ( const std::string &  sourceAccount,
const std::string &  sourceTag,
const std::string &  tagName,
int  statusCode,
const boost::posix_time::ptime &  insertionTime 
)
virtual

Implements cond::persistency::ITagMigrationTable.

Definition at line 405 of file IOVSchema.cc.

References cond::persistency::RowBuffer< Columns >::get(), and cond::persistency::TAG_MIGRATION::tname.

Referenced by BeautifulSoup.PageElement::_invert().

406  {
407  RowBuffer< SOURCE_ACCOUNT, SOURCE_TAG, TAG_NAME, STATUS_CODE, INSERTION_TIME >
408  dataToInsert( std::tie( sourceAccount, sourceTag, tagName, statusCode, insertionTime ) );
409  insertInTable( m_schema, tname, dataToInsert.get() );
410  }
static char const * tname
Definition: IOVSchema.h:139
bool cond::persistency::TAG_MIGRATION::Table::select ( const std::string &  sourceAccount,
const std::string &  sourceTag,
std::string &  tagName,
int &  statusCode 
)
virtual
void cond::persistency::TAG_MIGRATION::Table::updateValidationCode ( const std::string &  sourceAccount,
const std::string &  sourceTag,
int  statusCode 
)
virtual

Implements cond::persistency::ITagMigrationTable.

Definition at line 412 of file IOVSchema.cc.

References cond::persistency::UpdateBuffer::addWhereCondition(), cond::persistency::UpdateBuffer::setColumnData(), HLT_25ns14e33_v1_cff::sourceTag, and cond::persistency::TAG_MIGRATION::tname.

412  {
413  UpdateBuffer buffer;
414  buffer.setColumnData< STATUS_CODE >( std::tie( statusCode ) );
415  buffer.addWhereCondition<SOURCE_ACCOUNT>( sourceAccount );
416  buffer.addWhereCondition<SOURCE_TAG>( sourceTag );
417  updateTable( m_schema, tname, buffer );
418  }
static char const * tname
Definition: IOVSchema.h:139

Member Data Documentation

coral::ISchema& cond::persistency::TAG_MIGRATION::Table::m_schema
private

Definition at line 158 of file IOVSchema.h.