96 std::vector<MappingElement> dependentMappings;
98 RelationalDeleter depDeleter( dependentMappings );
99 depDeleter.build( operationBuffer );
100 dependentMappings.clear();
103 UpdateOperation* topLevelUpdate = &operationBuffer.newUpdate( topLevelMapping.tableName(),
true );
104 topLevelUpdate->addId( topLevelMapping.columnNames()[ 0 ] );
105 topLevelUpdate->addWhereId( topLevelMapping.columnNames()[ 0 ] );
109 if( iMap == topLevelMapping.end()){
111 type.Name(Reflex::SCOPED)+
"\"",
112 "UpdateBuffer::flush");
114 MappingElement& mapping = iMap->second;
115 RelationalStreamerFactory streamerFactory(
m_contSchema );
116 DataElement topLevelElement;
117 std::auto_ptr<IRelationalUpdater> updater( streamerFactory.newUpdater( type, mapping ));
118 updater->build( topLevelElement, *topLevelUpdate, operationBuffer );
119 for( std::vector<std::pair<int, const void*> >::const_iterator iU =
m_buffer.begin();
122 const void*
data = iU->second;
124 depDeleter.erase( oid );
125 coral::AttributeList& dataBuff = topLevelUpdate->data();
126 dataBuff.begin()->data<
int>() = oid;
127 coral::AttributeList& whereDataBuff = topLevelUpdate->whereData();
128 whereDataBuff.begin()->data<
int>() = oid;
129 updater->update( oid, data );
130 if( operationBuffer.flush()) nobj++;
const Reflex::Type & type()
bool mappingForDependentClasses(std::vector< MappingElement > &destination)
const MappingElement & topElement() const
std::map< std::string, MappingElement >::iterator iterator
Iterator definition.
std::vector< std::pair< int, const void * > > m_buffer
coral::ISchema & storageSchema()
char data[epos_bytes_allocation]
MappingTree & mapping(bool writeEnabled=false)
void throwException(const std::string &message, const std::string &methodName)
ContainerSchema & m_contSchema