views:

106

answers:

2

I'm writing Java app using GWT on Google AppEngine. So I have JDO Entities on Server side and POJO DTOs on Client's side. For some of my entities I have to use Key objects for ids Pojo's cannot have that object because that is not standard class. is there any easy work around for this so I can use Key object on server side and String or Long on client's side.

+1  A: 

The question is a duplicate, like the comment says, but I'll add another thing for you to think about. I'm trying out Objectify now and I think its fantastic (and its fully operable with GWT without DTOs.) Take a look at it.

Sudhir Jonathan
A: 

You can use the Key class in GWT code by adding these additional jar files:

http://www.resmarksystems.com/code/

  • appengine-utils-client-1.0.jar
  • appengine-utils-server-1.0.jar

This basically gives the GWT compiler a GWT-friendly version of the Key and other AppEngine classes. (like Text, Blob and User..)

To use:

  • Add the appengine-utils-client-1.0.jar anywhere in your build path.
  • Put the appengine-utils-server-1.0.jar to your WEB-INF/lib folder.

In your GWT module add the following:

<inherits name="com.resmarksystems.AppEngineDataTypes"/>
nick