here's the setup: I'm using GWT 2.4 with gwt-platform 0.7. I have a bunch of classes that contain key-value-pairs (at the moment int->String). They are just different classes because they get saved to different tables in database via JPA.
Now I'd like to have one(!) method to fetch this data from the server.
I first tried to send to the server the classes I'd like to fetch using ArrayList<Class<?>>
. And answer with HashMap<Class<?>, HashMap<Integer, String>>
. But GWT doesn't allow to serialize Class<?>
. This way I could get all the database entries and display them with the right class associated (that's important) very easily.
Now I am looking for another way to get it working without having to write lot's of code.
The first new idea was to have a HashMap<String, Class<?>>
somewhere inside the shared
folder and just transfer the String over the wire. So the client and server would have to create a new object by finding the class via the String in the HashMap.
Is there any other good solution for this?
Thank you.