Bug #871 ยป t2.diff
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;
|