CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions

ora::OraClassVersionTable Class Reference

#include <OraDatabaseSchema.h>

Inheritance diagram for ora::OraClassVersionTable:
ora::IDatabaseTable

List of all members.

Public Member Functions

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

Static Public Member Functions

static std::string classIdColumn ()
static std::string classNameColumn ()
static std::string classVersionColumn ()
static std::string containerIdColumn ()
static std::string dependencyIndexColumn ()
static std::string mappingVersionColumn ()
static std::string tableName ()

Detailed Description

Definition at line 114 of file OraDatabaseSchema.h.


Constructor & Destructor Documentation

ora::OraClassVersionTable::OraClassVersionTable ( coral::ISchema &  dbSchema) [explicit]

Definition at line 626 of file OraDatabaseSchema.cc.

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

Definition at line 630 of file OraDatabaseSchema.cc.

                                              {
}

Member Function Documentation

std::string ora::OraClassVersionTable::classIdColumn ( ) [static]
std::string ora::OraClassVersionTable::classNameColumn ( ) [static]
std::string ora::OraClassVersionTable::classVersionColumn ( ) [static]
std::string ora::OraClassVersionTable::containerIdColumn ( ) [static]
void ora::OraClassVersionTable::create ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 641 of file OraDatabaseSchema.cc.

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

                                    {
  if( schema().existsTable( tableName() )){
    throwException( "ORA database class version table already exists in this schema.",
                    "OraClassVersionTable::create");
  }
  // class version table
  coral::TableDescription description1( "OraDb" );
  description1.setName( tableName() );
  description1.insertColumn( classNameColumn(),
                             coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
  description1.setNotNullConstraint( classNameColumn() );
  description1.insertColumn( classVersionColumn(),
                             coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
  description1.setNotNullConstraint( classVersionColumn() );
  description1.insertColumn( classIdColumn(),
                             coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
  description1.setNotNullConstraint( classIdColumn() );
  description1.insertColumn( dependencyIndexColumn(),
                             coral::AttributeSpecification::typeNameForType<int>() );
  description1.setNotNullConstraint(  dependencyIndexColumn() );
  description1.insertColumn( containerIdColumn(),
                             coral::AttributeSpecification::typeNameForType<int>() );
  description1.setNotNullConstraint(  containerIdColumn() );
  description1.insertColumn( mappingVersionColumn(),
                             coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
  description1.setNotNullConstraint( mappingVersionColumn() );
  std::vector<std::string> cols1;
  cols1.push_back( classIdColumn() );
  cols1.push_back( containerIdColumn() );
  description1.setPrimaryKey( cols1 );
  std::string fk10Name = mappingVersionColumn()+"_FK10";
  description1.createForeignKey( fk10Name, mappingVersionColumn(),
                                 ora::OraMappingVersionTable::tableName(),ora::OraMappingVersionTable::mappingVersionColumn());
  std::string fk11Name = containerIdColumn()+"_FK11";
  description1.createForeignKey( fk11Name, containerIdColumn(),
                                 ora::OraContainerHeaderTable::tableName(),ora::OraContainerHeaderTable::containerIdColumn());
  schema().createTable( description1 );
}
std::string ora::OraClassVersionTable::dependencyIndexColumn ( ) [static]
void ora::OraClassVersionTable::drop ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 680 of file OraDatabaseSchema.cc.

References python::IdGenerator::schema.

                                  {
  schema().dropIfExistsTable( tableName() );
}
bool ora::OraClassVersionTable::exists ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 637 of file OraDatabaseSchema.cc.

References python::IdGenerator::schema.

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

Implements ora::IDatabaseTable.

Definition at line 633 of file OraDatabaseSchema.cc.

                                       {
  return tableName();
}
std::string ora::OraClassVersionTable::tableName ( ) [static]