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::OraClassVersionTable Class Reference

#include <OraDatabaseSchema.h>

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

Public Member Functions

void create ()
 
void drop ()
 
bool exists ()
 
std::string name ()
 
 OraClassVersionTable (coral::ISchema &dbSchema)
 
virtual ~OraClassVersionTable ()
 
- 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 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.

626  :
627  IDatabaseTable( dbSchema ){
628 }
IDatabaseTable(coral::ISchema &schema)
ora::OraClassVersionTable::~OraClassVersionTable ( )
virtual

Definition at line 630 of file OraDatabaseSchema.cc.

630  {
631 }

Member Function Documentation

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

Definition at line 604 of file OraDatabaseSchema.cc.

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

604  {
605  static std::string s_col("CLASS_ID");
606  return s_col;
607 }
std::string ora::OraClassVersionTable::classNameColumn ( )
static

Definition at line 594 of file OraDatabaseSchema.cc.

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

594  {
595  static std::string s_col("CLASS_NAME");
596  return s_col;
597 }
std::string ora::OraClassVersionTable::classVersionColumn ( )
static

Definition at line 599 of file OraDatabaseSchema.cc.

Referenced by ora::OraMappingSchema::getClassVersionListForContainer(), ora::OraMappingSchema::getClassVersionListForMappingVersion(), and ora::OraMappingSchema::insertClassVersion().

599  {
600  static std::string s_col("CLASS_VERSION");
601  return s_col;
602 }
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, ora::OraMappingVersionTable::tableName(), ora::OraContainerHeaderTable::tableName(), and ora::throwException().

641  {
642  if( schema().existsTable( tableName() )){
643  throwException( "ORA database class version table already exists in this schema.",
644  "OraClassVersionTable::create");
645  }
646  // class version table
647  coral::TableDescription description1( "OraDb" );
648  description1.setName( tableName() );
649  description1.insertColumn( classNameColumn(),
650  coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
651  description1.setNotNullConstraint( classNameColumn() );
652  description1.insertColumn( classVersionColumn(),
653  coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
654  description1.setNotNullConstraint( classVersionColumn() );
655  description1.insertColumn( classIdColumn(),
656  coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
657  description1.setNotNullConstraint( classIdColumn() );
658  description1.insertColumn( dependencyIndexColumn(),
659  coral::AttributeSpecification::typeNameForType<int>() );
660  description1.setNotNullConstraint( dependencyIndexColumn() );
661  description1.insertColumn( containerIdColumn(),
662  coral::AttributeSpecification::typeNameForType<int>() );
663  description1.setNotNullConstraint( containerIdColumn() );
664  description1.insertColumn( mappingVersionColumn(),
665  coral::AttributeSpecification::typeNameForType<std::string>(), 1000, false);
666  description1.setNotNullConstraint( mappingVersionColumn() );
667  std::vector<std::string> cols1;
668  cols1.push_back( classIdColumn() );
669  cols1.push_back( containerIdColumn() );
670  description1.setPrimaryKey( cols1 );
671  std::string fk10Name = mappingVersionColumn()+"_FK10";
672  description1.createForeignKey( fk10Name, mappingVersionColumn(),
674  std::string fk11Name = containerIdColumn()+"_FK11";
675  description1.createForeignKey( fk11Name, containerIdColumn(),
677  schema().createTable( description1 );
678 }
static std::string classIdColumn()
static std::string mappingVersionColumn()
static std::string tableName()
static std::string classNameColumn()
static std::string tableName()
static std::string tableName()
coral::ISchema & schema()
static std::string classVersionColumn()
static std::string mappingVersionColumn()
static std::string containerIdColumn()
static std::string dependencyIndexColumn()
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
static std::string containerIdColumn()
std::string ora::OraClassVersionTable::dependencyIndexColumn ( )
static

Definition at line 609 of file OraDatabaseSchema.cc.

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

609  {
610  static std::string s_col("DEPENDENCY_INDEX");
611  return s_col;
612 }
void ora::OraClassVersionTable::drop ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 680 of file OraDatabaseSchema.cc.

References python.IdGenerator::schema.

680  {
681  schema().dropIfExistsTable( tableName() );
682 }
static std::string tableName()
coral::ISchema & schema()
bool ora::OraClassVersionTable::exists ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 637 of file OraDatabaseSchema.cc.

References python.IdGenerator::schema.

637  {
638  return schema().existsTable( tableName() );
639 }
static std::string tableName()
coral::ISchema & schema()
std::string ora::OraClassVersionTable::mappingVersionColumn ( )
static
std::string ora::OraClassVersionTable::name ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 633 of file OraDatabaseSchema.cc.

Referenced by Vispa.Views.PropertyView.Property::valueChanged().

633  {
634  return tableName();
635 }
static std::string tableName()
std::string ora::OraClassVersionTable::tableName ( )
static