00001 #include "CondCore/DBCommon/interface/ObjectRelationalMappingUtility.h" 00002 #include "ObjectRelationalAccess/ObjectRelationalMappingUtilities.h" 00003 #include "ObjectRelationalAccess/ObjectRelationalMappingPersistency.h" 00004 #include "RelationalAccess/ISessionProxy.h" 00005 cond::ObjectRelationalMappingUtility::ObjectRelationalMappingUtility( coral::ISessionProxy* coralsessionHandle ):m_coralsessionHandle(coralsessionHandle){ 00006 m_mappingutil=new pool::ObjectRelationalMappingUtilities( coralsessionHandle ); 00007 } 00008 cond::ObjectRelationalMappingUtility::~ObjectRelationalMappingUtility(){ 00009 delete m_mappingutil; 00010 } 00011 void cond::ObjectRelationalMappingUtility::buildAndStoreMappingFromBuffer( const std::string& buffer ){ 00012 m_mappingutil->buildAndMaterializeMappingFromBuffer( buffer.c_str(),false,false ); 00013 } 00014 void cond::ObjectRelationalMappingUtility::buildAndStoreMappingFromFile( const std::string& filename ){ 00015 m_mappingutil->buildAndMaterializeMapping( filename,"",false,false ); 00016 } 00017 00018 /*void cond::ObjectRelationalMappingUtility::listMappings( std::vector<std::string>& mappinglist ){ 00019 mappinglist=m_mappingutil->listMappings(); 00020 } 00021 */ 00022 bool cond::ObjectRelationalMappingUtility::existsMapping(const std::string& version){ 00023 pool::ObjectRelationalMappingPersistency mappingPersistency(m_coralsessionHandle->nominalSchema()); 00024 if(!mappingPersistency.existsMappingDatabase()) return false; 00025 return m_mappingutil->existsMapping(version); 00026 } 00027 00028 void cond::ObjectRelationalMappingUtility::removeMapping(const std::string& version,bool removeTables){ 00029 m_mappingutil->removeMapping(version,removeTables); 00030 } 00031 00032