VVVideoRepository::update
The
update() member function of
VVVideoRepository accepts three parameters, first two of which are instances of
VVVideo. The first instance identifies the record to be changed, while the second instance is used as new information. The third parameter is an instance of
RWDBConnection which is used to execute the update.
VVVideoRepository&
VVVideoRepository::update(const VVVideo& originalVideo,
const VVVideo& newVideo,
const RWDBConnection& aConnection) //1
{
RWDBUpdater anUpdater = table_.updater(); //2
anUpdater.where(idColumn_ == originalVideo.id()); //3
anUpdater << titleColumn_.assign(newVideo.title())
<< idColumn_.assign(newVideo.id())
<< yearColumn_.assign(newVideo.year())
<< categoryColumn_.assign(newVideo.category())
<< quantityColumn_.assign(newVideo.quantity())
<< numOnHandColumn_.assign(newVideo.numOnHand())
<< synopsisColumn_.assign(newVideo.synopsis()); //4
anUpdater.execute(aConnection); //5
return *this;
}