CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions

ora::OraMappingElementTable Class Reference

#include <OraDatabaseSchema.h>

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

List of all members.

Public Member Functions

void create ()
void drop ()
bool exists ()
std::string name ()
 OraMappingElementTable (coral::ISchema &dbSchema)
virtual ~OraMappingElementTable ()

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.

                                                                          :
  IDatabaseTable( dbSchema ){
}
ora::OraMappingElementTable::~OraMappingElementTable ( ) [virtual]

Definition at line 332 of file OraDatabaseSchema.cc.

                                                  {
}

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().

                                                     {
  static std::string s_col("COLUMN_NAME");
  return s_col;  
}
void ora::OraMappingElementTable::create ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 343 of file OraDatabaseSchema.cc.

References ora::OraMappingVersionTable::mappingVersionColumn(), python::IdGenerator::schema, AlCaHLTBitMon_QueryRunRegistry::string, ora::OraMappingVersionTable::tableName(), and ora::throwException().

                                      {
  if( schema().existsTable( tableName() )){
    throwException( "ORA database mapping element table already exists in this schema.",
                    "OraMappingElementTable::create");
  }

  // mapping elements table
  coral::TableDescription description2( "OraDb" );
  description2.setName( tableName() );
  description2.insertColumn(  mappingVersionColumn(),
                              coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false );
  description2.setNotNullConstraint(  mappingVersionColumn() );
  description2.insertColumn(  elementIdColumn(),
                              coral::AttributeSpecification::typeNameForType<int>() );
  description2.setNotNullConstraint(  elementIdColumn() );
  description2.insertColumn(  elementTypeColumn(),
                              coral::AttributeSpecification::typeNameForType<std::string>() );
  description2.setNotNullConstraint(  elementTypeColumn() );
  description2.insertColumn(  scopeNameColumn(),
                              coral::AttributeSpecification::typeNameForType<std::string>() );
  description2.setNotNullConstraint(  scopeNameColumn() );
  description2.insertColumn( variableNameColumn(),
                             coral::AttributeSpecification::typeNameForType<std::string>() );
  description2.setNotNullConstraint( variableNameColumn() );
  description2.insertColumn( variableParIndexColumn(),
                              coral::AttributeSpecification::typeNameForType<unsigned int>() );
  description2.setNotNullConstraint(  variableParIndexColumn() );
  description2.insertColumn(  variableTypeColumn(),
                              coral::AttributeSpecification::typeNameForType<std::string>() );
  description2.setNotNullConstraint(  variableTypeColumn() );
  description2.insertColumn(  tableNameColumn(),
                              coral::AttributeSpecification::typeNameForType<std::string>() );
  description2.setNotNullConstraint(  tableNameColumn() );
  description2.insertColumn(  columnNameColumn(),
                              coral::AttributeSpecification::typeNameForType<std::string>() );
  description2.setNotNullConstraint(  columnNameColumn() );
  std::vector<std::string> cols2;
  cols2.push_back(  elementIdColumn() );
  cols2.push_back(  variableParIndexColumn() );
  description2.setPrimaryKey( cols2 );
  std::string fkName20 = mappingVersionColumn()+"_FK_1";
  description2.createForeignKey( fkName20, mappingVersionColumn(),
                                 OraMappingVersionTable::tableName(),OraMappingVersionTable::mappingVersionColumn());
  schema().createTable( description2 );
  
}
void ora::OraMappingElementTable::drop ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 390 of file OraDatabaseSchema.cc.

References python::IdGenerator::schema.

                                    {
  schema().dropIfExistsTable( tableName() );
}
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().

                                                    {
  static std::string s_col("ELEMENT_ID");
  return s_col;
}
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().

                                                      {
  static std::string s_col("ELEMENT_TYPE");
  return s_col;  
}
bool ora::OraMappingElementTable::exists ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 339 of file OraDatabaseSchema.cc.

References python::IdGenerator::schema.

                                      {
  return schema().existsTable( tableName() );
}
std::string ora::OraMappingElementTable::mappingVersionColumn ( ) [static]
std::string ora::OraMappingElementTable::name ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 335 of file OraDatabaseSchema.cc.

                                         {
  return tableName();
}
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().

                                                    {
  static std::string s_col("VARIABLE_SCOPE");
  return s_col;
}
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().

                                                       {
  static std::string s_col("VARIABLE_NAME");
  return s_col;
}
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().

                                                           {
  static std::string s_col("VARIABLE_PAR_INDEX");
  return s_col;
}
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().

                                                       {
  static std::string s_col("VARIABLE_TYPE");
  return s_col;

}