Reputation: 1587
I have a class called "Order" which has one pointer that points to a class called Product. To pull the order object and the associated product I use include.("productPointer") which is my pointer column name. This is working fine.
Now this Product class has an array of pointers pointing to another class called ProductImage in a column called "imagePointer". Now when I call the Order object, I want to pull the Product object (which I am able to do) and along with that the objects in ProductImage as well within the same query.
Basically the Product can have multiple images which are not a fixed number. To overcome this I have made another class called ProductImage and reference all the images from that via array of pointers to specific ProductObjects.
I am unable to figure this out.
Upvotes: 1
Views: 102
Reputation: 548
You can also do multi level includes using dot notation, for your example it'd be:
yourQuery.include("productPointer").include("productPointer.imagePointer")
If you change the imagePointer
column from Product to an array you can also use this query to prefetch all columns you need:
yourQuery.include("productPointer").include("productPointer.imageArray")
Upvotes: 1