CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions
ora::OraMappingElementTable Class Reference

#include <OraDatabaseSchema.h>

Inheritance diagram for ora::OraMappingElementTable:
ora::IDatabaseTable

Public Member Functions

void create ()
 
void drop ()
 
bool exists ()
 
std::string name ()
 
 OraMappingElementTable (coral::ISchema &dbSchema)
 
virtual ~OraMappingElementTable ()
 
- Public Member Functions inherited from ora::IDatabaseTable
 IDatabaseTable (coral::ISchema &schema)
 
coral::ISchema & schema ()
 
virtual void setAccessPermission (const std::string &principal, bool forWrite)
 
virtual ~IDatabaseTable ()
 

Static Public Member Functions

static std::string columnNameColumn ()
 
static std::string elementIdColumn ()
 
static std::string elementTypeColumn ()
 
static std::string mappingVersionColumn ()
 
static std::string scopeNameColumn ()
 
static std::string tableName ()
 
static std::string tableNameColumn ()
 
static std::string variableNameColumn ()
 
static std::string variableParIndexColumn ()
 
static std::string variableTypeColumn ()
 

Detailed Description

Definition at line 66 of file OraDatabaseSchema.h.

Constructor & Destructor Documentation

ora::OraMappingElementTable::OraMappingElementTable ( coral::ISchema &  dbSchema)
explicit

Definition at line 328 of file OraDatabaseSchema.cc.

328  :
329  IDatabaseTable( dbSchema ){
330 }
IDatabaseTable(coral::ISchema &schema)
ora::OraMappingElementTable::~OraMappingElementTable ( )
virtual

Definition at line 332 of file OraDatabaseSchema.cc.

332  {
333 }

Member Function Documentation

std::string ora::OraMappingElementTable::columnNameColumn ( )
static

Definition at line 323 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

323  {
324  static const std::string s_col("COLUMN_NAME");
325  return s_col;
326 }
void ora::OraMappingElementTable::create ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 343 of file OraDatabaseSchema.cc.

References ora::OraMappingVersionTable::mappingVersionColumn(), dataDML::schema, AlCaHLTBitMon_QueryRunRegistry::string, HLT_Fake_cff::tableName, ora::OraMappingVersionTable::tableName(), and ora::throwException().

343  {
344  if( schema().existsTable( tableName() )){
345  throwException( "ORA database mapping element table already exists in this schema.",
346  "OraMappingElementTable::create");
347  }
348 
349  // mapping elements table
350  coral::TableDescription description2( "OraDb" );
351  description2.setName( tableName() );
352  description2.insertColumn( mappingVersionColumn(),
353  coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false );
354  description2.setNotNullConstraint( mappingVersionColumn() );
355  description2.insertColumn( elementIdColumn(),
356  coral::AttributeSpecification::typeNameForType<int>() );
357  description2.setNotNullConstraint( elementIdColumn() );
358  description2.insertColumn( elementTypeColumn(),
359  coral::AttributeSpecification::typeNameForType<std::string>() );
360  description2.setNotNullConstraint( elementTypeColumn() );
361  description2.insertColumn( scopeNameColumn(),
362  coral::AttributeSpecification::typeNameForType<std::string>() );
363  description2.setNotNullConstraint( scopeNameColumn() );
364  description2.insertColumn( variableNameColumn(),
365  coral::AttributeSpecification::typeNameForType<std::string>() );
366  description2.setNotNullConstraint( variableNameColumn() );
367  description2.insertColumn( variableParIndexColumn(),
368  coral::AttributeSpecification::typeNameForType<unsigned int>() );
369  description2.setNotNullConstraint( variableParIndexColumn() );
370  description2.insertColumn( variableTypeColumn(),
371  coral::AttributeSpecification::typeNameForType<std::string>() );
372  description2.setNotNullConstraint( variableTypeColumn() );
373  description2.insertColumn( tableNameColumn(),
374  coral::AttributeSpecification::typeNameForType<std::string>() );
375  description2.setNotNullConstraint( tableNameColumn() );
376  description2.insertColumn( columnNameColumn(),
377  coral::AttributeSpecification::typeNameForType<std::string>() );
378  description2.setNotNullConstraint( columnNameColumn() );
379  std::vector<std::string> cols2;
380  cols2.push_back( elementIdColumn() );
381  cols2.push_back( variableParIndexColumn() );
382  description2.setPrimaryKey( cols2 );
383  std::string fkName20 = mappingVersionColumn()+"_FK_1";
384  description2.createForeignKey( fkName20, mappingVersionColumn(),
386  schema().createTable( description2 );
387 
388 }
static std::string variableNameColumn()
static std::string mappingVersionColumn()
static std::string tableName()
static std::string tableNameColumn()
static std::string elementTypeColumn()
static std::string variableParIndexColumn()
static std::string tableName()
static std::string variableTypeColumn()
coral::ISchema & schema()
static std::string mappingVersionColumn()
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
static std::string scopeNameColumn()
static std::string columnNameColumn()
static std::string elementIdColumn()
void ora::OraMappingElementTable::drop ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 390 of file OraDatabaseSchema.cc.

References dataDML::schema, and HLT_Fake_cff::tableName.

390  {
391  schema().dropIfExistsTable( tableName() );
392 }
static std::string tableName()
coral::ISchema & schema()
std::string ora::OraMappingElementTable::elementIdColumn ( )
static

Definition at line 287 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

287  {
288  static const std::string s_col("ELEMENT_ID");
289  return s_col;
290 }
std::string ora::OraMappingElementTable::elementTypeColumn ( )
static

Definition at line 292 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

292  {
293  static const std::string s_col("ELEMENT_TYPE");
294  return s_col;
295 }
bool ora::OraMappingElementTable::exists ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 339 of file OraDatabaseSchema.cc.

References dataDML::schema, and HLT_Fake_cff::tableName.

339  {
340  return schema().existsTable( tableName() );
341 }
static std::string tableName()
coral::ISchema & schema()
std::string ora::OraMappingElementTable::mappingVersionColumn ( )
static
std::string ora::OraMappingElementTable::name ( )
virtual
std::string ora::OraMappingElementTable::scopeNameColumn ( )
static

Definition at line 297 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

297  {
298  static const std::string s_col("VARIABLE_SCOPE");
299  return s_col;
300 }
std::string ora::OraMappingElementTable::tableName ( )
static
std::string ora::OraMappingElementTable::tableNameColumn ( )
static
std::string ora::OraMappingElementTable::variableNameColumn ( )
static

Definition at line 302 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

302  {
303  static const std::string s_col("VARIABLE_NAME");
304  return s_col;
305 }
std::string ora::OraMappingElementTable::variableParIndexColumn ( )
static

Definition at line 307 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

307  {
308  static const std::string s_col("VARIABLE_PAR_INDEX");
309  return s_col;
310 }
std::string ora::OraMappingElementTable::variableTypeColumn ( )
static

Definition at line 312 of file OraDatabaseSchema.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraMappingSchema::getMapping(), and ora::OraMappingSchema::storeMapping().

312  {
313  static const std::string s_col("VARIABLE_TYPE");
314  return s_col;
315 
316 }