Project

General

Profile

Bug #871 ยป t2.diff

Boris Nagaev, 06/23/2011 12:04 PM

View differences:

examples/feature/dbo/tutorial2.C
dbo::ptr<Tag> cooking = session.add(new Tag());
cooking.modify()->name = "Cooking";
post.modify()->tags.insert(cooking);
Post* p = post.modify();
if (p->tags.find().where("id = ?").bind(cooking.id()).resultList().size() == 0)
p->tags.insert(cooking);
// will print '1 post(s) tagged with Cooking.'
std::cerr << cooking->posts.size() << " post(s) tagged with Cooking." << std::endl;
    (1-1/1)