Sending Key object via RPC to client

44 views
Skip to first unread message

xxJohnnyxx

unread,
Nov 25, 2012, 9:32:37 AM11/25/12
to google-we...@googlegroups.com
Hello,

via an RPC call I want to send a class(witch contains a Key variable) to the client. I figured out that there are some issues with that sort of variable on the client side, and I get this error:
Line 9: The import com.google.appengine.api.datastore cannot be resolved

So I have found some old solutions for this problem, but could not get them working for me... My question is, are there any up to date solutions? And are there more variable types the client side has problems to handle with?

Thanks!!!

Thomas Broyer

unread,
Nov 25, 2012, 12:22:15 PM11/25/12
to google-we...@googlegroups.com

On Sunday, November 25, 2012 3:32:37 PM UTC+1, xxJohnnyxx wrote:
Hello,

via an RPC call I want to send a class(witch contains a Key variable) to the client. I figured out that there are some issues with that sort of variable on the client side, and I get this error:
Line 9: The import com.google.appengine.api.datastore cannot be resolved

So I have found some old solutions for this problem, but could not get them working for me... My question is, are there any up to date solutions?

Many GAE DataStore "helper libs" (Slim3 and Objectify at least) provide emulation and a CustomFieldSerializer for the Key class so it can be used on the client-side and transmitted over GWT-RPC.
AFAICT you could also use the String representation of the Key in your class, and transform from/back to Key in your code that accesses the DataStore.

And are there more variable types the client side has problems to handle with?

Reply all
Reply to author
Forward
0 new messages