GWT RequestFactory with GAE, may cause conflict when fetch object using locator?

18 views
Skip to first unread message

July

unread,
Oct 6, 2011, 7:49:40 AM10/6/11
to google-we...@googlegroups.com
Hi all:

From the requestFactory locator class, there is an abstract method:
  public abstract T find(Class<? extends T> clazz, I id);

This is to retrieve an unique object with Class clazz and its id, however i notice in app engine with the class and its ID are not enough to identify one unique object, because in GAE(I use Objectify) only id+Class+parent could identify one object, in other word, there may exist one object with same ID and same Class but different Parent in GAE datastore, in this situation, it may fetch the wrong object.

Any ideas?
Thanks.



Thomas Broyer

unread,
Oct 6, 2011, 8:12:01 AM10/6/11
to google-we...@googlegroups.com
In that case, the ID of your object is the "parent+id" pair (or actually, parent+kind+id-or-name triplet), which you can easily get using ObjectifyFactory#keyToString.

July

unread,
Oct 6, 2011, 8:35:16 AM10/6/11
to google-we...@googlegroups.com
Thank Thomas now i see it.
Reply all
Reply to author
Forward
0 new messages