Hi,
I am trying to use ancestor filters, but it does not work as I expect it to.
I have a shop entity with an id generated by the datastore.
I have an order entity with an id I set myself, and the parent of the order is the shop.
I have a transaction entity with an id I set myself, and the parent of the transaction is the order.
Now I would like to get the transactions which has a given shop ancestor, so I set the ancestor on the transaction query like this:
query.setAncestor(KeyFactory.createKey("shop", shop.getId()));
where shop.getId() is a string, i.e. the key name.
But when I execute the query I do not get any results.
Did I misunderstod how ancestor filters are to be used?
When I create orders I can see the parent is set to the shop as expected, when I create transactions I can see the parent is set to the shop as expected.
But when I have a transaction entity and call transaction.getParent().getParent() I would expect to get the shop, but I get null.
Thanks,
-Louise