CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::DatabaseUtility Class Reference

#include <DatabaseUtility.h>

List of all members.

Public Member Functions

 DatabaseUtility ()
 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 ( )

Definition at line 8 of file DatabaseUtility.cc.

                                   :
  m_session(){
}
ora::DatabaseUtility::DatabaseUtility ( Handle< DatabaseUtilitySession > &  session) [explicit]

Definition at line 12 of file DatabaseUtility.cc.

                                                                                   :
  m_session( utilitySession ){
}
ora::DatabaseUtility::DatabaseUtility ( const DatabaseUtility rhs)

Definition at line 16 of file DatabaseUtility.cc.

                                                               :
  m_session( rhs.m_session ){
}
ora::DatabaseUtility::~DatabaseUtility ( ) [virtual]

Definition at line 20 of file DatabaseUtility.cc.

                                    {
}

Member Function Documentation

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

Definition at line 46 of file DatabaseUtility.cc.

                                                                  {
  return m_session->dumpMapping( mappingVersion,outputStream );
}
void ora::DatabaseUtility::eraseMapping ( const std::string &  mappingVersion)

Definition at line 61 of file DatabaseUtility.cc.

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

                                                                      {
  m_session->eraseMapping( mappingVersion );
}
void ora::DatabaseUtility::importContainer ( const std::string &  sourceConnectionString,
const std::string &  containerName 
)

Definition at line 56 of file DatabaseUtility.cc.

                                                                            {
  m_session->importContainer( sourceConnectionString, containerName );
}
void ora::DatabaseUtility::importContainerSchema ( const std::string &  sourceConnectionString,
const std::string &  containerName 
)

Definition at line 51 of file DatabaseUtility.cc.

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

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

Definition at line 37 of file DatabaseUtility.cc.

References cont, and ora::throwException().

                                                                                            {
  Handle<DatabaseContainer> cont = m_session->containerHandle( containerName );
  if( !cont ){
    throwException("Container \""+containerName+"\" does not exist in the database.",
                   "DatabaseUtility::listMappings");
  }
  return m_session->listMappings( cont->id() );  
}
std::set< std::string > ora::DatabaseUtility::listMappingVersions ( const std::string &  containerName)

Definition at line 28 of file DatabaseUtility.cc.

References cont, and ora::throwException().

                                                                                         {
  Handle<DatabaseContainer> cont = m_session->containerHandle( containerName );
  if( !cont ){
    throwException("Container \""+containerName+"\" does not exist in the database.",
                   "DatabaseUtility::listMappingVersions");
  }
  return m_session->listMappingVersions( cont->id() );
}
ora::DatabaseUtility & ora::DatabaseUtility::operator= ( const DatabaseUtility rhs)

Definition at line 23 of file DatabaseUtility.cc.

References m_session.

                                                                             {
  m_session = rhs.m_session;
  return *this;
}

Member Data Documentation

Definition at line 51 of file DatabaseUtility.h.

Referenced by operator=().