[odb-users] Querying on Containers

Boris Kolpackov boris at codesynthesis.com
Fri Oct 7 11:07:45 EDT 2016


Hi Lukas,

Lukas Obermann <obermann.lukas at gmail.com> writes:

> class main
> {
>   odb::lazy_shared_ptr<ClassA> ptr_a;
>   std::vector< odb::lazy_shared_ptr<ClassA> > list_a;
>   std::vector< odb::lazy_shared_ptr<ClassB> > ptr_b
> }
> 
> class ClassA
> {
>   std::string iNeedToBeQueried;
> }
> 
> class ClassB
> {
>   std::string iNeedToBeQueried;
>   odb::lazy_shared_ptr<ClassC> ptr_c;
> }
> 
> class ClassC
> {
>   std::string iNeedToBeQueried;
> }

So you have containers of pointers -- this is even easier.


> So, ptr_a is no issue, but I am not able to figure out how to add the two
> vectors to the view and also access ClassC, all at the same time.

You just add their classes to the view. Check this earlier thread, it
is exactly the same problem:

http://codesynthesis.com/pipermail/odb-users/2016-August/003412.html

Boris



More information about the odb-users mailing list