Querying hierarchical entities in Voyage

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Querying hierarchical entities in Voyage

Uko2
Hi,

how can I query all the objects from a hierarchy? Should a do separate query for each subclass and then concatenate the results? Is there a more efficient solution?

Also what is the place to read about Voyage?

Yuriy
Reply | Threaded
Open this post in threaded view
|

Re: Querying hierarchical entities in Voyage

NorbertHartl

> Am 14.09.2015 um 15:41 schrieb Yuriy Tymchuk <[hidden email]>:
>
> Hi,
>
> how can I query all the objects from a hierarchy? Should a do separate query for each subclass and then concatenate the results? Is there a more efficient solution?
>
You can put something like that in your base class

mongoContainer
        <mongoContainer>
        ^ VOMongoContainer new
                collectionName: 'user';
                yourself

So every subclass will be stored in the user collection as well. If you query on the base class you will get all subclasses as well.

Norbert

> Also what is the place to read about Voyage?
>



Reply | Threaded
Open this post in threaded view
|

Re: Querying hierarchical entities in Voyage

Uko2
Thanks Norbert!

> On 14 Sep 2015, at 17:31, Norbert Hartl <[hidden email]> wrote:
>
>
>> Am 14.09.2015 um 15:41 schrieb Yuriy Tymchuk <[hidden email]>:
>>
>> Hi,
>>
>> how can I query all the objects from a hierarchy? Should a do separate query for each subclass and then concatenate the results? Is there a more efficient solution?
>>
> You can put something like that in your base class
>
> mongoContainer
> <mongoContainer>
> ^ VOMongoContainer new
> collectionName: 'user';
> yourself
>
> So every subclass will be stored in the user collection as well. If you query on the base class you will get all subclasses as well.
>
> Norbert
>
>> Also what is the place to read about Voyage?
>>
>
>
>