[odb-users] Re: 2-table query
MM
finjulhich at gmail.com
Mon Sep 14 16:27:52 EDT 2015
On 14 September 2015 at 15:45, Boris Kolpackov <boris at codesynthesis.com>
wrote:
> MM <finjulhich at gmail.com> writes:
>
> > odb generates the ?xx files, but it doesn't compile
>
> What is the error?!
>
>
> > #pragma db view object(F) object(M: F::get_m)\
> > query( F::month.in (M::month1, M::month2) )
>
> ODB in() function only works on values, not members. I guess that's
> the error but I shouldn't be guessing.
>
> Boris
>
I see. I changed that. Thanks.
For the pragma syntax:
*object(**name* [*=* *alias*] [*join-type*] [*:* *join-condition*]*)*
In my case, I have 2 associated objects. F and M.
One can obtain the M object from the F object through this public member
function
struct F : public Base {
...
const M* getM() const override;
};
I couldn't find out how to express the *join-condition.*
I tried (and used 2 aliases as well) this:
#pragma db view object(::NS::NS1::F = fctrct) object(::NS::NS2::M = fmkt:
fctrct::getM)
The error by the odb compiler is:
error: unable to resolve data member 'getM' specified with db pragma object
Basically, I don't understand the syntax of the join-condition. The example
in the manual show actual data members. I couldn't find an example with a
function member .
Rds,
More information about the odb-users
mailing list