39 InsertOperation* topLevelInsert = &operationBuffer.newInsert( topLevelMapping.tableName() );
40 topLevelInsert->addId( topLevelMapping.columnNames()[ 0 ] );
44 if( iMap == topLevelMapping.end()){
46 type.Name(Reflex::SCOPED)+
"\"",
47 "WriteBuffer::flush");
49 MappingElement& mapping = iMap->second;
50 RelationalStreamerFactory streamerFactory(
m_contSchema );
51 DataElement topLevelElement;
52 std::auto_ptr<IRelationalWriter> writer( streamerFactory.newWriter( type, mapping ) );
53 writer->build( topLevelElement, *topLevelInsert, operationBuffer );
55 for( std::vector<std::pair<int, const void*> >::const_iterator iW =
m_buffer.begin();
58 const void*
data = iW->second;
59 coral::AttributeList& dataBuff = topLevelInsert->data();
60 dataBuff.begin()->data<
int>() = oid;
61 writer->write( oid, data );
62 if( operationBuffer.flush() ) nobj++;
ContainerSchema & m_contSchema
const Reflex::Type & type()
const MappingElement & topElement() const
std::vector< std::pair< int, const void * > > m_buffer
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
coral::ISchema & storageSchema()
char data[epos_bytes_allocation]
MappingTree & mapping(bool writeEnabled=false)
void throwException(const std::string &message, const std::string &methodName)