CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::InputRelationalData Class Reference

#include <RelationalOperation.h>

Inheritance diagram for ora::InputRelationalData:
ora::IRelationalData ora::BulkInsertOperation ora::DeleteOperation ora::InsertOperation ora::UpdateOperation

List of all members.

Public Member Functions

int addBlobData (const std::string &columnName)
int addData (const std::string &columnName, const std::type_info &columnType)
int addId (const std::string &columnName)
int addWhereId (const std::string &columnName, ConditionType cond)
int addWhereId (const std::string &columnName)
coral::AttributeList & data ()
 InputRelationalData ()
std::string & updateClause ()
std::string & whereClause ()
coral::AttributeList & whereData ()
virtual ~InputRelationalData ()

Private Attributes

coral::AttributeList m_data
std::string m_setClause
std::string m_whereClause

Detailed Description

Definition at line 58 of file RelationalOperation.h.


Constructor & Destructor Documentation

ora::InputRelationalData::InputRelationalData ( )

Definition at line 34 of file RelationalOperation.cc.

                                           :
  m_data(),
  m_setClause(""),
  m_whereClause(""){
}
ora::InputRelationalData::~InputRelationalData ( ) [virtual]

Definition at line 40 of file RelationalOperation.cc.

                                            {
}

Member Function Documentation

int ora::InputRelationalData::addBlobData ( const std::string &  columnName) [virtual]

Implements ora::IRelationalData.

Definition at line 66 of file RelationalOperation.cc.

References ora::existAttribute(), and getHLTprescales::index.

                                                                  {
  int index = existAttribute( columnName, m_data );
  if(index == -1){
    m_data.extend<coral::Blob>( columnName );
    index = m_data.size()-1;
    if(!m_setClause.empty()) m_setClause += ", ";
    m_setClause += ( columnName +"= :"+columnName );
  }
  return index;
}
int ora::InputRelationalData::addData ( const std::string &  columnName,
const std::type_info &  columnType 
) [virtual]

Implements ora::IRelationalData.

Definition at line 54 of file RelationalOperation.cc.

References ora::existAttribute(), and getHLTprescales::index.

                                                                      {
  int index = existAttribute( columnName, m_data );
  if(index == -1){
    m_data.extend( columnName, columnType );
    index = m_data.size()-1;
    if(!m_setClause.empty()) m_setClause += ", ";
    m_setClause += ( columnName +"= :"+columnName );
  }
  return index;
}
int ora::InputRelationalData::addId ( const std::string &  columnName) [virtual]

Implements ora::IRelationalData.

Definition at line 43 of file RelationalOperation.cc.

References ora::existAttribute(), and getHLTprescales::index.

Referenced by ora::DependentClassWriter::build(), ora::UpdateBuffer::UpdateBuffer(), and ora::WriteBuffer::WriteBuffer().

                                                            {
  int index = existAttribute( columnName, m_data );
  if(index == -1){
    m_data.extend<int>( columnName );
    index = m_data.size()-1;
    if(!m_setClause.empty()) m_setClause += ", ";
    m_setClause += ( columnName +"= :"+columnName );
  }
  return index;
}
int ora::InputRelationalData::addWhereId ( const std::string &  columnName,
ConditionType  cond 
)

Definition at line 88 of file RelationalOperation.cc.

References ora::conditionOfType(), ora::existAttribute(), and getHLTprescales::index.

                                                                                           {
  int index = existAttribute( columnName, m_data );
  if( index == -1 ){
    m_data.extend<int>( columnName );
    index = m_data.size()-1;
    if(!m_whereClause.empty()) m_whereClause += " AND ";
    m_whereClause += ( columnName +conditionOfType(condType)+" :"+columnName );
  }
  return index;
}
int ora::InputRelationalData::addWhereId ( const std::string &  columnName) [virtual]

Implements ora::IRelationalData.

Definition at line 77 of file RelationalOperation.cc.

References ora::existAttribute(), and getHLTprescales::index.

Referenced by ora::RelationalDeleter::build(), ora::deleteArrayElements(), and ora::UpdateBuffer::UpdateBuffer().

                                                                   {
  int index = existAttribute( columnName, m_data );
  if(index == -1){
    m_data.extend<int>( columnName );
    index = m_data.size()-1;
  }
  if(!m_whereClause.empty()) m_whereClause += " AND ";
  m_whereClause += ( columnName +"= :"+columnName );
  return index;
}
coral::AttributeList & ora::InputRelationalData::data ( ) [virtual]
std::string & ora::InputRelationalData::updateClause ( )

Definition at line 108 of file RelationalOperation.cc.

                                               {
  return m_setClause;
}
std::string & ora::InputRelationalData::whereClause ( ) [virtual]

Implements ora::IRelationalData.

Definition at line 112 of file RelationalOperation.cc.

                                              {
  return m_whereClause;
}
coral::AttributeList & ora::InputRelationalData::whereData ( ) [virtual]

Implements ora::IRelationalData.

Definition at line 103 of file RelationalOperation.cc.

Referenced by ora::deleteArrayElements(), and ora::UpdateBuffer::update().

                                                     {
  // data and where data are hosted in the same buffer (as for update operation)
  return m_data;
}

Member Data Documentation

coral::AttributeList ora::InputRelationalData::m_data [private]

Definition at line 90 of file RelationalOperation.h.

Definition at line 91 of file RelationalOperation.h.

Definition at line 92 of file RelationalOperation.h.