CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ArrayCommonImpl.cc
Go to the documentation of this file.
1 #include "ArrayCommonImpl.h"
2 #include "MappingElement.h"
3 #include "RelationalBuffer.h"
4 #include "RelationalOperation.h"
5 // externals
6 #include "CoralBase/Attribute.h"
7 
9  int oid,
10  int fromIndex,
11  RelationalBuffer& buffer ){
12  for ( MappingElement::iterator iMe = mapping.begin();
13  iMe != mapping.end(); ++iMe ) {
14  MappingElement::ElementType elementType = iMe->second.elementType();
15  // add the InlineCArray (or change the algorithm...
16  if ( elementType == MappingElement::Object ||
17  elementType == MappingElement::Array ||
18  elementType == MappingElement::OraArray ||
19  elementType == MappingElement::CArray ) {
20  deleteArrayElements( iMe->second, oid, fromIndex, buffer );
21  }
22  }
23  if ( mapping.elementType() == MappingElement::Object) return;
24 
25  std::string oidColumn = mapping.columnNames()[ 0 ];
26  std::string indexColumn = mapping.columnNames()[ 1 ];
27  DeleteOperation& deleteOperation = buffer.newDelete( mapping.tableName() );
28  deleteOperation.addWhereId( oidColumn );
29  deleteOperation.addWhereId( indexColumn, Ge );
30  coral::AttributeList::iterator condDataIter = deleteOperation.whereData().begin();
31  condDataIter->data<int>() = oid;
32  ++condDataIter;
33  condDataIter->data<int>() = fromIndex;
34 }
35 
36 
int addWhereId(const std::string &columnName)
coral::AttributeList & whereData()
ElementType elementType() const
iterator begin()
Returns an iterator in the beginning of the sequence.
void deleteArrayElements(MappingElement &mapping, int oid, int fromIndex, RelationalBuffer &buffer)
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
const std::vector< std::string > & columnNames() const
iterator end()
Returns an iterator in the end of the sequence.
const std::string & tableName() const
DeleteOperation & newDelete(const std::string &tableName, bool addToResult=false)