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.

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

323  {
324  static 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(), python.IdGenerator::schema, 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()
static std::string scopeNameColumn()
static std::string columnNameColumn()
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
static std::string elementIdColumn()
void ora::OraMappingElementTable::drop ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 390 of file OraDatabaseSchema.cc.

References python.IdGenerator::schema.

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.

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

287  {
288  static 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.

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

292  {
293  static 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 python.IdGenerator::schema.

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

Definition at line 282 of file OraDatabaseSchema.cc.

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

282  {
283  static std::string s_col("MAPPING_VERSION");
284  return s_col;
285 }
std::string ora::OraMappingElementTable::name ( )
virtual

Implements ora::IDatabaseTable.

Definition at line 335 of file OraDatabaseSchema.cc.

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

335  {
336  return tableName();
337 }
static std::string tableName()
std::string ora::OraMappingElementTable::scopeNameColumn ( )
static

Definition at line 297 of file OraDatabaseSchema.cc.

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

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

Definition at line 318 of file OraDatabaseSchema.cc.

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

318  {
319  static std::string s_col("TABLE_NAME");
320  return s_col;
321 }
std::string ora::OraMappingElementTable::variableNameColumn ( )
static

Definition at line 302 of file OraDatabaseSchema.cc.

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

302  {
303  static 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.

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

307  {
308  static 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.

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

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