void ExtractModel::act(AV& av, collection_nvp<E,S> nvp ) { E* entry; construct(av, &entry, static_cast<unsigned int>(0)); av.diveTable(nvp.name); putNamedColumn(av.getScope().table(), HIBERLITE_PARENTID_COLUMN, HIBERLITE_ID_STORAGE_CLASS); putNamedColumn(av.getScope().table(), HIBERLITE_ENTRY_INDEX_COLUMN, HIBERLITE_ID_STORAGE_CLASS); sql_nvp<E> el("item",*entry); av & el; av.pop(); destroy(*this, entry, static_cast<unsigned int>(0)); }
void UpdateBean::act(AV& av, collection_nvp<E,S> nvp ){ sqlid_t index=0; S& stream=nvp.stream; av.diveTable(nvp.name); std::string tab=av.getScope().table(); while(!stream.done()){ E& el=stream.getNext(); sqlid_t entry_id=Database::allocId(av.getConnection(), tab); startRow(tab,entry_id, curRow()->id,index); sql_nvp<E> el_nvp("item",el); av & el_nvp; commitRow(av.getConnection(), entry_id); index++; } av.pop(); }