#include <OraDatabaseSchema.h>
Definition at line 181 of file OraDatabaseSchema.h.
ora::OraDatabaseSchema::OraDatabaseSchema | ( | coral::ISchema & | dbSchema | ) | [explicit] |
Definition at line 1267 of file OraDatabaseSchema.cc.
: IDatabaseSchema( dbSchema ), m_schema( dbSchema ), m_mainTable( dbSchema ), m_sequenceTable( dbSchema ), m_mappingVersionTable( dbSchema ), m_mappingElementTable( dbSchema ), m_containerHeaderTable( dbSchema ), m_classVersionTable( dbSchema ), m_mappingSchema( dbSchema ), m_namingServiceTable( dbSchema ){ }
ora::OraDatabaseSchema::~OraDatabaseSchema | ( | ) | [virtual] |
Definition at line 1280 of file OraDatabaseSchema.cc.
{ }
ora::IDatabaseTable & ora::OraDatabaseSchema::classVersionTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1354 of file OraDatabaseSchema.cc.
{ return m_classVersionTable; }
ora::IContainerHeaderTable & ora::OraDatabaseSchema::containerHeaderTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1350 of file OraDatabaseSchema.cc.
{ return m_containerHeaderTable; }
void ora::OraDatabaseSchema::create | ( | const std::string & | userSchemaVersion | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1302 of file OraDatabaseSchema.cc.
References ora::IMainTable::userSchemaVersionParameterName().
{ m_mainTable.create(); m_mainTable.setParameter( IMainTable::userSchemaVersionParameterName(), userSchemaVersion ); m_sequenceTable.create(); m_mappingVersionTable.create(); m_mappingElementTable.create(); m_containerHeaderTable.create(); m_classVersionTable.create(); m_namingServiceTable.create(); }
void ora::OraDatabaseSchema::drop | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1313 of file OraDatabaseSchema.cc.
{ m_namingServiceTable.drop(); m_classVersionTable.drop(); m_containerHeaderTable.drop(); m_mappingElementTable.drop(); m_mappingVersionTable.drop(); m_sequenceTable.drop(); m_mainTable.drop(); }
bool ora::OraDatabaseSchema::exists | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1283 of file OraDatabaseSchema.cc.
References ora::throwException().
{ if(!m_mainTable.exists()){ return false; } if(!m_namingServiceTable.exists()) throwException( "ORA database is corrupted. Naming Service table is missing", "OraDatabaseSchema::exists"); if(!m_sequenceTable.exists()) throwException( "ORA database is corrupted. Sequence table is missing.","OraDatabaseSchema::exists"); if(!m_mappingVersionTable.exists()) throwException( "ORA database is corrupted. Mapping Version table is missing.","OraDatabaseSchema::exists"); if(!m_mappingElementTable.exists()) throwException( "ORA database is corrupted. Mapping Element table is missing.","OraDatabaseSchema::exists"); if(!m_containerHeaderTable.exists()) throwException( "ORA database is corrupted. Container Header table is missing.","OraDatabaseSchema::exists"); if(!m_classVersionTable.exists()) throwException( "ORA database is corrupted. Class Version table is missing.","OraDatabaseSchema::exists"); return true; }
bool ora::OraDatabaseSchema::existsMainTable | ( | coral::ISchema & | dbSchema | ) | [static] |
Definition at line 1067 of file OraDatabaseSchema.cc.
References ora::OraMainTable::exists(), and tmp.
Referenced by ora::IDatabaseSchema::createSchemaHandle().
ora::IMainTable & ora::OraDatabaseSchema::mainTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1334 of file OraDatabaseSchema.cc.
{ return m_mainTable; }
ora::IDatabaseTable & ora::OraDatabaseSchema::mappingElementTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1346 of file OraDatabaseSchema.cc.
{ return m_mappingElementTable; }
ora::IMappingSchema & ora::OraDatabaseSchema::mappingSchema | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1358 of file OraDatabaseSchema.cc.
{ return m_mappingSchema; }
ora::IDatabaseTable & ora::OraDatabaseSchema::mappingVersionTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1342 of file OraDatabaseSchema.cc.
{ return m_mappingVersionTable; }
ora::INamingServiceTable & ora::OraDatabaseSchema::namingServiceTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1362 of file OraDatabaseSchema.cc.
{ return m_namingServiceTable; }
ora::ISequenceTable & ora::OraDatabaseSchema::sequenceTable | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1338 of file OraDatabaseSchema.cc.
{ return m_sequenceTable; }
void ora::OraDatabaseSchema::setAccessPermission | ( | const std::string & | principal, |
bool | forWrite | ||
) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1323 of file OraDatabaseSchema.cc.
{ m_mainTable.setAccessPermission( principal, forWrite ); m_sequenceTable.setAccessPermission( principal, forWrite ); m_mappingVersionTable.setAccessPermission( principal, forWrite ); m_mappingElementTable.setAccessPermission( principal, forWrite ); m_containerHeaderTable.setAccessPermission( principal, forWrite ); m_classVersionTable.setAccessPermission( principal, forWrite ); m_namingServiceTable.setAccessPermission( principal, forWrite ); }
bool ora::OraDatabaseSchema::testDropPermission | ( | ) | [virtual] |
Implements ora::IDatabaseSchema.
Definition at line 1366 of file OraDatabaseSchema.cc.
References Exception, run_regression::ret, stor::utils::sleep(), and ora::throwException().
{ // horrible work-around to avoid the attempt to DROP a db with no permission: // due to Oracle implicit COMMIT after any DDL attempt (successful or not...), the previous DELETE on containers are commited // as a result the ora db is left corrupted bool ret = false; std::string tableName("ORA_TEST_DROP"); if( m_schema.existsTable( tableName )){ throwException( "ORA_TEST_DROP table already exists in this schema.", "OraNameTable::testDropPermission"); } try{ coral::TableDescription descr( "OraDb" ); descr.setName( tableName ); descr.insertColumn( "DUMMY", coral::AttributeSpecification::typeNameForType<int>() ); m_schema.createTable( descr ); ret = true; ::sleep(1); }catch ( const coral::Exception& ){ ret = false; } if(ret ) m_schema.dropIfExistsTable( tableName ); return ret; }
Definition at line 211 of file OraDatabaseSchema.h.
Definition at line 210 of file OraDatabaseSchema.h.
Definition at line 206 of file OraDatabaseSchema.h.
Definition at line 209 of file OraDatabaseSchema.h.
Definition at line 212 of file OraDatabaseSchema.h.
Definition at line 208 of file OraDatabaseSchema.h.
Definition at line 213 of file OraDatabaseSchema.h.
coral::ISchema& ora::OraDatabaseSchema::m_schema [private] |
Reimplemented from ora::IDatabaseSchema.
Definition at line 205 of file OraDatabaseSchema.h.
Definition at line 207 of file OraDatabaseSchema.h.