I am currently working on a simple web application through the Google App engine using GWT. It should be noted that this is my first attempt to complete such a task.
I ran into the following problem / dilemma:
I have a simple class (getters / seters and nothing more. For clarity, I will refer to this class as a DataHolder ), and I want to make it persistent. For this, I used JDO , which required me to add some annotations and, more specifically, add the Key field, which will be used as the primary key.
The problem is that using the Key class requires me to import com.google.appengine.api.datastore.Key , which is good on the server side, but then I can not use the DataHolder on the client side, because GWT do not let me ( as far as I know).
So, I created the sister class ClientDataHolder , which is almost identical, although it does not have all the JDO or Key annotations.
Now it works, but it seems like I'm doing something wrong. Using this approach will require the support of two separate classes for each object that I want to have.
So my question is: is there a better way to do this?
Thanks.
source share