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
cond::persistency::OraPayloadTable Class Reference

#include <OraDbSchema.h>

Inheritance diagram for cond::persistency::OraPayloadTable:
cond::persistency::IPayloadTable

Public Member Functions

void create ()
 
bool exists ()
 
bool getType (const cond::Hash &payloadHash, std::string &objectType)
 
cond::Hash insertIfNew (const std::string &objectType, const cond::Binary &payloadData, const cond::Binary &streamerInfoData, const boost::posix_time::ptime &insertionTime)
 
 OraPayloadTable (DbSession &session)
 
bool select (const cond::Hash &payloadHash, std::string &objectType, cond::Binary &payloadData, cond::Binary &streamerInfoData)
 
virtual ~OraPayloadTable ()
 
- Public Member Functions inherited from cond::persistency::IPayloadTable
virtual ~IPayloadTable ()
 

Private Attributes

cond::DbSession m_session
 

Detailed Description

Definition at line 68 of file OraDbSchema.h.

Constructor & Destructor Documentation

cond::persistency::OraPayloadTable::OraPayloadTable ( DbSession session)
explicit

Definition at line 125 of file OraDbSchema.cc.

125  :
126  m_session( session ){
127  }
virtual cond::persistency::OraPayloadTable::~OraPayloadTable ( )
inlinevirtual

Definition at line 71 of file OraDbSchema.h.

71 {}

Member Function Documentation

void cond::persistency::OraPayloadTable::create ( )
inlinevirtual

Implements cond::persistency::IPayloadTable.

Definition at line 75 of file OraDbSchema.h.

75  {
76  }
bool cond::persistency::OraPayloadTable::exists ( )
inlinevirtual

Implements cond::persistency::IPayloadTable.

Definition at line 72 of file OraDbSchema.h.

72  {
73  return true;
74  }
bool cond::persistency::OraPayloadTable::getType ( const cond::Hash payloadHash,
std::string &  objectType 
)
virtual
cond::Hash cond::persistency::OraPayloadTable::insertIfNew ( const std::string &  objectType,
const cond::Binary payloadData,
const cond::Binary streamerInfoData,
const boost::posix_time::ptime &  insertionTime 
)
virtual

Implements cond::persistency::IPayloadTable.

Definition at line 153 of file OraDbSchema.cc.

References cond::DbSession::flush(), m_session, getGTfromDQMFile::obj, cond::Binary::oraObject(), cond::DbSession::storeObject(), AlCaHLTBitMon_QueryRunRegistry::string, and results_mgr::tok.

156  {
157  ora::Object obj = payloadData.oraObject();
158  std::string tok = m_session.storeObject( obj, objectType );
159  m_session.flush();
160  return tok;
161  }
ora::Object oraObject() const
Definition: Binary.cc:62
std::string storeObject(const T *object, const std::string &containerName)
Definition: DbSession.h:132
bool cond::persistency::OraPayloadTable::select ( const cond::Hash payloadHash,
std::string &  objectType,
cond::Binary payloadData,
cond::Binary streamerInfoData 
)
virtual

Implements cond::persistency::IPayloadTable.

Definition at line 129 of file OraDbSchema.cc.

References alignCSCRings::e, cms::Exception::explainSelf(), cond::Binary::fromOraObject(), cond::DbSession::getObject(), m_session, getGTfromDQMFile::obj, and ora::Object::typeName().

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

133  {
135  try {
136  obj = m_session.getObject( payloadHash );
137  } catch( const ora::Exception& e ){
138  // hack to trap the non-existance of the object
139  if( e.explainSelf().find("has not been found in the database. from ReadBuffer::read") != std::string::npos ) {
140  return false;
141  } else throw;
142  }
143  objectType = obj.typeName();
144  payloadData.fromOraObject(obj );
145  return true;
146  }
std::string typeName() const
Definition: Object.cc:59
virtual std::string explainSelf() const
Definition: Exception.cc:146
void fromOraObject(const ora::Object &object)
Definition: Binary.cc:66
Base exception class for the object to relational access.
Definition: Exception.h:10
ora::Object getObject(const std::string &objectId)
Definition: DbSession.cc:268

Member Data Documentation

cond::DbSession cond::persistency::OraPayloadTable::m_session
private

Definition at line 82 of file OraDbSchema.h.

Referenced by getType(), insertIfNew(), and select().