5 #include "CoralBase/Blob.h"
9 m_query( tableName, schema ),
21 m_query.addOrderId( columnName );
22 m_idCols.push_back( columnName );
28 "MultiRecordSelectOperation::selectRow" );
30 Record rec; m_cache.lookupAndClear( selection,rec );
31 newAttributeListFromRecord( *m_row, rec );
35 size_t numberOfIndexes ){
36 if(m_cache.size()==0)
return 0;
37 return m_cache.branchSize(selection, numberOfIndexes);
49 m_spec.add( columnName,
typeid(
int) );
50 return m_query.addId( columnName );
54 const std::type_info& columnType ){
55 m_spec.add( columnName, columnType );
56 return m_query.addData( columnName, columnType );
60 m_spec.add( columnName,
typeid(coral::Blob) );
61 return m_query.addBlobData( columnName );
65 return m_query.addWhereId( columnName );
72 "MultiRecordSelectOperation::data" );
78 return m_query.whereData();
82 return m_query.whereClause();
90 std::vector<int> indexes;
91 while( m_query.nextCursorRow() ){
92 coral::AttributeList& row = m_query.data();
93 for(
size_t i=0;
i<m_idCols.size();
i++){
94 indexes.push_back( row[m_idCols[
i]].data<int>() );
97 newRecordFromAttributeList(rec, row );
98 m_cache.push( indexes, rec );
101 m_row.reset(
new coral::AttributeList(m_query.attributeListSpecification(),
true ));
~MultiRecordSelectOperation()
coral::AttributeList & data()
size_t selectionSize(const std::vector< int > &selection, size_t numberOfIndexes)
int addId(const std::string &columnName)
coral::AttributeList & whereData()
MultiRecordSelectOperation(const std::string &tableName, coral::ISchema &schema)
int addData(const std::string &columnName, const std::type_info &columnType)
std::string & whereClause()
int addWhereId(const std::string &columnName)
int addBlobData(const std::string &columnName)
void addOrderId(const std::string &columnName)
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
void selectRow(const std::vector< int > &selection)