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
ora::InputRelationalData Class Reference

#include <RelationalOperation.h>

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

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)
 
int addWhereId (const std::string &columnName, ConditionType cond)
 
coral::AttributeList & data ()
 
 InputRelationalData ()
 
std::string & updateClause ()
 
std::string & whereClause ()
 
coral::AttributeList & whereData ()
 
virtual ~InputRelationalData ()
 
- Public Member Functions inherited from ora::IRelationalData
virtual ~IRelationalData ()
 

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.

34  :
35  m_data(),
36  m_setClause(""),
37  m_whereClause(""){
38 }
coral::AttributeList m_data
ora::InputRelationalData::~InputRelationalData ( )
virtual

Definition at line 40 of file RelationalOperation.cc.

40  {
41 }

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.

66  {
67  int index = existAttribute( columnName, m_data );
68  if(index == -1){
69  m_data.extend<coral::Blob>( columnName );
70  index = m_data.size()-1;
71  if(!m_setClause.empty()) m_setClause += ", ";
72  m_setClause += ( columnName +"= :"+columnName );
73  }
74  return index;
75 }
int existAttribute(const std::string &attributeName, const coral::AttributeList &data)
coral::AttributeList m_data
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.

55  {
56  int index = existAttribute( columnName, m_data );
57  if(index == -1){
58  m_data.extend( columnName, columnType );
59  index = m_data.size()-1;
60  if(!m_setClause.empty()) m_setClause += ", ";
61  m_setClause += ( columnName +"= :"+columnName );
62  }
63  return index;
64 }
int existAttribute(const std::string &attributeName, const coral::AttributeList &data)
coral::AttributeList m_data
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::WriteBuffer::flush(), and ora::UpdateBuffer::flush().

43  {
44  int index = existAttribute( columnName, m_data );
45  if(index == -1){
46  m_data.extend<int>( columnName );
47  index = m_data.size()-1;
48  if(!m_setClause.empty()) m_setClause += ", ";
49  m_setClause += ( columnName +"= :"+columnName );
50  }
51  return index;
52 }
int existAttribute(const std::string &attributeName, const coral::AttributeList &data)
coral::AttributeList m_data
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::flush().

77  {
78  int index = existAttribute( columnName, m_data );
79  if(index == -1){
80  m_data.extend<int>( columnName );
81  index = m_data.size()-1;
82  }
83  if(!m_whereClause.empty()) m_whereClause += " AND ";
84  m_whereClause += ( columnName +"= :"+columnName );
85  return index;
86 }
int existAttribute(const std::string &attributeName, const coral::AttributeList &data)
coral::AttributeList m_data
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.

88  {
89  int index = existAttribute( columnName, m_data );
90  if( index == -1 ){
91  m_data.extend<int>( columnName );
92  index = m_data.size()-1;
93  if(!m_whereClause.empty()) m_whereClause += " AND ";
94  m_whereClause += ( columnName +conditionOfType(condType)+" :"+columnName );
95  }
96  return index;
97 }
const char * conditionOfType(ConditionType condType)
int existAttribute(const std::string &attributeName, const coral::AttributeList &data)
coral::AttributeList m_data
coral::AttributeList & ora::InputRelationalData::data ( )
virtual

Implements ora::IRelationalData.

Definition at line 99 of file RelationalOperation.cc.

Referenced by cuy.FindIssue::__init__(), ora::UpdateBuffer::flush(), and ora::DependentClassWriter::write().

99  {
100  return m_data;
101 }
coral::AttributeList m_data
std::string & ora::InputRelationalData::updateClause ( )

Definition at line 108 of file RelationalOperation.cc.

108  {
109  return m_setClause;
110 }
std::string & ora::InputRelationalData::whereClause ( )
virtual

Implements ora::IRelationalData.

Definition at line 112 of file RelationalOperation.cc.

112  {
113  return m_whereClause;
114 }
coral::AttributeList & ora::InputRelationalData::whereData ( )
virtual

Implements ora::IRelationalData.

Definition at line 103 of file RelationalOperation.cc.

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

103  {
104  // data and where data are hosted in the same buffer (as for update operation)
105  return m_data;
106 }
coral::AttributeList m_data

Member Data Documentation

coral::AttributeList ora::InputRelationalData::m_data
private

Definition at line 90 of file RelationalOperation.h.

std::string ora::InputRelationalData::m_setClause
private

Definition at line 91 of file RelationalOperation.h.

std::string ora::InputRelationalData::m_whereClause
private

Definition at line 92 of file RelationalOperation.h.