[odb-users] querying with relationships
Boris Kolpackov
boris at codesynthesis.com
Thu Jan 30 00:12:27 EST 2014
Hi Simón Emmanuel,
Simón Emmanuel Gutiérrez Brida <simon.gutierrez.brida at gmail.com> writes:
> I want to do a query like, get all patterns p from user such that
> user.id== user_id and p.category == cattegory.
Given the changes to your relationship that I suggested in my previous
reply[1], here is how we can do this:
typedef odb::query<Category> CategoryQuery;
db.query<Category> (CategoryQuery::user->id == user_id &&
CategoryQuery::category == category);
[1] http://codesynthesis.com/pipermail/odb-users/2014-January/001758.html
Boris
More information about the odb-users
mailing list