CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::DatabaseUtility Class Reference

#include <DatabaseUtility.h>

Public Member Functions

 DatabaseUtility (Handle< DatabaseUtilitySession > &session)
 
 DatabaseUtility (const DatabaseUtility &rhs)
 
bool dumpMapping (const std::string &mappingVersion, std::ostream &outputStream)
 
void eraseMapping (const std::string &mappingVersion)
 
void importContainer (const std::string &sourceConnectionString, const std::string &containerName)
 
void importContainerSchema (const std::string &sourceConnectionString, const std::string &containerName)
 
std::map< std::string,
std::string > 
listMappings (const std::string &containerName)
 
std::set< std::string > listMappingVersions (const std::string &containerName)
 
DatabaseUtilityoperator= (const DatabaseUtility &rhs)
 
virtual ~DatabaseUtility ()
 

Private Attributes

Handle< DatabaseUtilitySessionm_session
 

Detailed Description

Definition at line 14 of file DatabaseUtility.h.

Constructor & Destructor Documentation

ora::DatabaseUtility::DatabaseUtility ( Handle< DatabaseUtilitySession > &  session)
explicit

Definition at line 8 of file DatabaseUtility.cc.

8  :
9  m_session( utilitySession ){
10 }
Handle< DatabaseUtilitySession > m_session
ora::DatabaseUtility::DatabaseUtility ( const DatabaseUtility rhs)

Definition at line 12 of file DatabaseUtility.cc.

12  :
13  m_session( rhs.m_session ){
14 }
Handle< DatabaseUtilitySession > m_session
ora::DatabaseUtility::~DatabaseUtility ( )
virtual

Definition at line 16 of file DatabaseUtility.cc.

16  {
17 }

Member Function Documentation

bool ora::DatabaseUtility::dumpMapping ( const std::string &  mappingVersion,
std::ostream &  outputStream 
)

Definition at line 42 of file DatabaseUtility.cc.

43  {
44  return m_session->dumpMapping( mappingVersion,outputStream );
45 }
Handle< DatabaseUtilitySession > m_session
void ora::DatabaseUtility::eraseMapping ( const std::string &  mappingVersion)

Definition at line 57 of file DatabaseUtility.cc.

Referenced by cond::DbSession::deleteMapping().

57  {
58  m_session->eraseMapping( mappingVersion );
59 }
Handle< DatabaseUtilitySession > m_session
void ora::DatabaseUtility::importContainer ( const std::string &  sourceConnectionString,
const std::string &  containerName 
)

Definition at line 52 of file DatabaseUtility.cc.

53  {
54  m_session->importContainer( sourceConnectionString, containerName );
55 }
Handle< DatabaseUtilitySession > m_session
void ora::DatabaseUtility::importContainerSchema ( const std::string &  sourceConnectionString,
const std::string &  containerName 
)

Definition at line 47 of file DatabaseUtility.cc.

Referenced by cond::DbSession::importMapping().

48  {
49  m_session->importContainerSchema( sourceConnectionString, containerName );
50 }
Handle< DatabaseUtilitySession > m_session
std::map< std::string, std::string > ora::DatabaseUtility::listMappings ( const std::string &  containerName)

Definition at line 33 of file DatabaseUtility.cc.

References cont, ora::DatabaseContainer::id(), and ora::throwException().

33  {
34  Handle<DatabaseContainer> cont = m_session->containerHandle( containerName );
35  if( !cont ){
36  throwException("Container \""+containerName+"\" does not exist in the database.",
37  "DatabaseUtility::listMappings");
38  }
39  return m_session->listMappings( cont->id() );
40 }
Handle< DatabaseUtilitySession > m_session
int cont
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
std::set< std::string > ora::DatabaseUtility::listMappingVersions ( const std::string &  containerName)

Definition at line 24 of file DatabaseUtility.cc.

References cont, ora::DatabaseContainer::id(), and ora::throwException().

24  {
25  Handle<DatabaseContainer> cont = m_session->containerHandle( containerName );
26  if( !cont ){
27  throwException("Container \""+containerName+"\" does not exist in the database.",
28  "DatabaseUtility::listMappingVersions");
29  }
30  return m_session->listMappingVersions( cont->id() );
31 }
Handle< DatabaseUtilitySession > m_session
int cont
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
ora::DatabaseUtility & ora::DatabaseUtility::operator= ( const DatabaseUtility rhs)

Definition at line 19 of file DatabaseUtility.cc.

References m_session.

19  {
20  m_session = rhs.m_session;
21  return *this;
22 }
Handle< DatabaseUtilitySession > m_session

Member Data Documentation

Handle<DatabaseUtilitySession> ora::DatabaseUtility::m_session
private

Definition at line 48 of file DatabaseUtility.h.

Referenced by operator=().