CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DatabaseUtility.cc
Go to the documentation of this file.
6 #include "DatabaseContainer.h"
7 
9  m_session(){
10 }
11 
13  m_session( utilitySession ){
14 }
15 
17  m_session( rhs.m_session ){
18 }
19 
21 }
22 
24  m_session = rhs.m_session;
25  return *this;
26 }
27 
28 std::set<std::string> ora::DatabaseUtility::listMappingVersions( const std::string& containerName ){
29  Handle<DatabaseContainer> cont = m_session->containerHandle( containerName );
30  if( !cont ){
31  throwException("Container \""+containerName+"\" does not exist in the database.",
32  "DatabaseUtility::listMappingVersions");
33  }
34  return m_session->listMappingVersions( cont->id() );
35 }
36 
37 std::map<std::string,std::string> ora::DatabaseUtility::listMappings( const std::string& containerName ){
38  Handle<DatabaseContainer> cont = m_session->containerHandle( containerName );
39  if( !cont ){
40  throwException("Container \""+containerName+"\" does not exist in the database.",
41  "DatabaseUtility::listMappings");
42  }
43  return m_session->listMappings( cont->id() );
44 }
45 
46 bool ora::DatabaseUtility::dumpMapping( const std::string& mappingVersion,
47  std::ostream& outputStream ){
48  return m_session->dumpMapping( mappingVersion,outputStream );
49 }
50 
51 void ora::DatabaseUtility::importContainerSchema( const std::string& sourceConnectionString,
52  const std::string& containerName ){
53  m_session->importContainerSchema( sourceConnectionString, containerName );
54 }
55 
56 void ora::DatabaseUtility::importContainer( const std::string& sourceConnectionString,
57  const std::string& containerName ){
58  m_session->importContainer( sourceConnectionString, containerName );
59 }
60 
61 void ora::DatabaseUtility::eraseMapping( const std::string& mappingVersion ){
62  m_session->eraseMapping( mappingVersion );
63 }
64 
DatabaseUtility & operator=(const DatabaseUtility &rhs)
void importContainerSchema(const std::string &sourceConnectionString, const std::string &containerName)
Handle< DatabaseUtilitySession > m_session
std::set< std::string > listMappingVersions(const std::string &containerName)
bool dumpMapping(const std::string &mappingVersion, std::ostream &outputStream)
int cont
std::map< std::string, std::string > listMappings(const std::string &containerName)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
void importContainer(const std::string &sourceConnectionString, const std::string &containerName)
void eraseMapping(const std::string &mappingVersion)