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 111 of file OraDatabaseSchema.h.


Constructor & Destructor Documentation

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

Definition at line 624 of file OraDatabaseSchema.cc.

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

Definition at line 628 of file OraDatabaseSchema.cc.

                                              {
}

Member Function Documentation

std::string ora::OraClassVersionTable::classIdColumn ( ) [static]

Definition at line 602 of file OraDatabaseSchema.cc.

Referenced by ora::OraMappingSchema::insertClassVersion(), ora::OraMappingSchema::selectMappingVersion(), and ora::OraMappingSchema::setMappingVersion().

                                                {
  static std::string s_col("CLASS_ID");
  return s_col;
}
std::string ora::OraClassVersionTable::classNameColumn ( ) [static]

Definition at line 592 of file OraDatabaseSchema.cc.

Referenced by ora::OraMappingSchema::getDependentClassesInContainerMapping(), and ora::OraMappingSchema::insertClassVersion().

                                                  {
  static std::string s_col("CLASS_NAME");
  return s_col;
}
std::string ora::OraClassVersionTable::classVersionColumn ( ) [static]
std::string ora::OraClassVersionTable::containerIdColumn ( ) [static]
void ora::OraClassVersionTable::create ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 639 of file OraDatabaseSchema.cc.

References ora::OraContainerHeaderTable::containerIdColumn(), ora::OraMappingVersionTable::mappingVersionColumn(), python::IdGenerator::schema, 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 );
  //.privilegeManager().grantToPublic( coral::ITablePrivilegeManager::Select );
}
std::string ora::OraClassVersionTable::dependencyIndexColumn ( ) [static]
void ora::OraClassVersionTable::drop ( ) [virtual]

Implements ora::IDatabaseTable.

Definition at line 679 of file OraDatabaseSchema.cc.

References python::IdGenerator::schema.

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

Implements ora::IDatabaseTable.

Definition at line 635 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 631 of file OraDatabaseSchema.cc.

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