Hi Hugo,

The Gilead framework (http://gilead.sourceforge.net) _ formerly known
as hibernate4gwt_ was developed to solve such issues.

Hope this helps.
Bruno

On 11 jan, 23:03, huma <[email protected]> wrote:
> Hi people.
>
> I've been developing an application with hibernate + spring + gwt, and
> i've come to a point where i need some help from you!
>
> I know that hibernate generates PersistentBag for Lists ( Hibernate
> implementation of List), and I need to serialize this lists. But I
> know that GWT doesn't support PersistentBag.
>
> So, and because i've read that we can implement a custom field
> serializer, i developed a PersistentBag_CustomFieldSerializer, like
> this:
>
> package org.hibernate.collection;
>
> import com.google.gwt.user.client.rpc.SerializationException;
> import com.google.gwt.user.client.rpc.SerializationStreamReader;
> import com.google.gwt.user.client.rpc.SerializationStreamWriter;
>
> /**
>  * Custom field serializer for {...@link
> org.hibernate.collection.PersistentBag}.
>  */
> public final class PersistentBag_CustomFieldSerializer {
>
>     public static void deserialize(SerializationStreamReader
> streamReader, PersistentBag instance) throws SerializationException {
>         int size = streamReader.readInt();
>         for (int i = 0; i < size; ++i) {
>             Object obj = streamReader.readObject();
>             instance.add(obj);
>         }
>     }
>
>     public static void serialize(SerializationStreamWriter
> streamWriter, PersistentBag instance) throws SerializationException {
>         int size = instance.size();
>         streamWriter.writeInt(size);
>         for (Object o : instance) {
>             streamWriter.writeObject(o);
>         }
>     }
>
> }
>
> With this development, the server serializes the instance, with no
> error, but the client return's a message saying
> "This application is out of date, please click the refresh button on
> your browser."
>
> Could anyone provide with possible hints to solve this error.
>
> Best regards
>
> Hugo Marcelino
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to