> So a Person can have a favored Food. But a Food is not linked to only
> one Person, but can be the favored Food of more than one Person.
> Ok, I understand that we don’t have a Food-Object in the class Person,
> but instead we have the Key to the food.
> Ok, now I want to get the favored Food Object of a Person. How do I
> get now the Food Object?
>
> Is the only way to get it by calling the getObjectById() or to make a
> query like “SELECT FROM Food WHERE key = person.getFavoredFoodKey()”
> Is there another fully automatically way to get the Food-Object?

Well what have you got ... the Key. So you get the object from that.
By storing the "related" object as a Key in your class you accepted
the need to get it back yourself when you need it.
I don't see how there can be any "automatic" way when you don't have a
reference to the "related" object anywhere in your object; hence why
JDO doesn't standardise any such process.

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to