[odb-users] Correct way to create query on column of referred to table in one-to-one relationship

Boris Kolpackov boris at codesynthesis.com
Mon Oct 7 14:59:28 EDT 2013


Hi Paul,

Paul Harrison <Paul.Harrison at manchester.ac.uk> writes:

> typedef odb::query<Data_Descriptor_P> DDQuery;
> typedef odb::query<Data_Location_P> DLQuery;
> 
> DDQuery query =  DDQuery (DLQuery::location == DLQuery::_val("tmp"))

I think what you are looking for is this:

typedef odb::query<Data_Descriptor_P> DDQuery;

DDQuery q = DDQuery::data_location->location == DLQuery::_val("tmp");

In other words, you can use query members that correspond to object
pointers "as if" they were actual pointers.

Boris



More information about the odb-users mailing list