Thanks for the reply. That's fair enough I can see why getOrders() in the
add() method can be problematic. I actually thought it lazy loaded the
collection under the covers, such that calling get() wouldn't actually fetch
everything - looks like I was wrong about that.
So I need to figure out how to refactor the add() code to add the order to
the collection some other way. Any tips on that? Do I have to create my own
Key that includes the parent Key?
I still have the problem that as of right now I can not actually call
account.getOrders() - for any reason, adding to it, or simply reading from
it. It just freezes up, burns a bunch of CPU and then times out. Seems a bit
of a waste even having the child relationship mapped.
I'm just testing a Query approach right now, which I imagine is the query
that would be running under the covers to access the orders of an account:
Query query = pm.newQuery(Order.class);
query.setFilter("account == accountKey");
query.declareParameters(Key.class.getName() + " accountKey");
query.setOrdering("orderDate desc");
I'll report back what I find out. Hopefully it allows me to get the accounts
orders - if nothing else at least I can cursor through them with a query.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.