test
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::BulkInsertOperation Class Reference

#include <RelationalOperation.h>

Inheritance diagram for ora::BulkInsertOperation:
ora::InputRelationalData ora::IRelationalOperation ora::IRelationalData

Public Member Functions

 BulkInsertOperation (const std::string &tableName, coral::ISchema &schema)
 
bool execute ()
 
bool isRequired ()
 
void reset ()
 
coral::IBulkOperation & setUp (int rowCacheSize)
 
 ~BulkInsertOperation ()
 
- Public Member Functions inherited from ora::InputRelationalData
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 ()
 
- Public Member Functions inherited from ora::IRelationalOperation
virtual ~IRelationalOperation ()
 

Private Attributes

std::vector
< coral::IBulkOperation * > 
m_bulkOperations
 
coral::ISchema & m_schema
 
std::string m_tableName
 

Detailed Description

Definition at line 110 of file RelationalOperation.h.

Constructor & Destructor Documentation

ora::BulkInsertOperation::BulkInsertOperation ( const std::string &  tableName,
coral::ISchema &  schema 
)

Definition at line 140 of file RelationalOperation.cc.

141  :
144  m_schema( schema ),
146 }
std::vector< coral::IBulkOperation * > m_bulkOperations
ora::BulkInsertOperation::~BulkInsertOperation ( )

Definition at line 148 of file RelationalOperation.cc.

148  {
149  for( std::vector<coral::IBulkOperation*>::iterator iB = m_bulkOperations.begin();
150  iB != m_bulkOperations.end(); ++iB ){
151  delete *iB;
152  }
153 }
std::vector< coral::IBulkOperation * > m_bulkOperations

Member Function Documentation

bool ora::BulkInsertOperation::execute ( )
virtual

Implements ora::IRelationalOperation.

Definition at line 167 of file RelationalOperation.cc.

167  {
168  for( std::vector<coral::IBulkOperation*>::iterator iB = m_bulkOperations.begin();
169  iB != m_bulkOperations.end(); ++iB ){
170  (*iB)->flush();
171  delete *iB;
172  }
173  m_bulkOperations.clear();
174  return true;
175 }
std::vector< coral::IBulkOperation * > m_bulkOperations
bool ora::BulkInsertOperation::isRequired ( )
virtual

Implements ora::IRelationalOperation.

Definition at line 163 of file RelationalOperation.cc.

163  {
164  return false;
165 }
void ora::BulkInsertOperation::reset ( void  )
virtual

Implements ora::IRelationalOperation.

Definition at line 177 of file RelationalOperation.cc.

Referenced by MatrixReader.MatrixReader::__init__(), and MatrixReader.MatrixReader::showRaw().

177  {
178  for( std::vector<coral::IBulkOperation*>::iterator iB = m_bulkOperations.begin();
179  iB != m_bulkOperations.end(); ++iB ){
180  delete *iB;
181  }
182  m_bulkOperations.clear();
183 }
std::vector< coral::IBulkOperation * > m_bulkOperations
coral::IBulkOperation & ora::BulkInsertOperation::setUp ( int  rowCacheSize)

Definition at line 155 of file RelationalOperation.cc.

References data, and table.

155  {
156  coral::ITable& table = m_schema.tableHandle( m_tableName );
157 
158  m_bulkOperations.push_back( table.dataEditor().bulkInsert( data(), rowCacheSize ) );
159  return *m_bulkOperations.back();
160 }
#define table(NAME)
Definition: DbCore.h:49
coral::AttributeList & data()
std::vector< coral::IBulkOperation * > m_bulkOperations

Member Data Documentation

std::vector<coral::IBulkOperation*> ora::BulkInsertOperation::m_bulkOperations
private

Definition at line 123 of file RelationalOperation.h.

coral::ISchema& ora::BulkInsertOperation::m_schema
private

Definition at line 122 of file RelationalOperation.h.

std::string ora::BulkInsertOperation::m_tableName
private

Definition at line 121 of file RelationalOperation.h.