Sorry, I just re-read your question and noticed that you're actually asking about something else, namely using the RPC serialization mechanism manually in your client-side code. Unfortunately, this isn't currently possible, at least not directly. The GWT RPC serialization mechanism is asymmetric. That is, code that is serialized from the server-side can only be deserialized on the client, and code that is serialized on the client-side can only be deserialized on the server. That said, you could try to reproduce a logical equivalent to the serialization logic used on the server in the client, but that would require some considerable overhead since GWT RPC server-side serialization uses reflection, which is not supported and would have to be emulated in the client.
However, you could take a look at Protocol Buffers in order to accomplish your goal. These provide a symmetric means for encoding structured data that you could share between your server-side and client-side and persist to the Gears database. Although you can implement your own solution, Protocol Buffer support isn't currently available in GWT proper, but is planned (see Issue #2649 linked below). Protocol Buffers: http://code.google.com/p/protobuf/ Issue # 2649: http://code.google.com/p/google-web-toolkit/issues/detail?id=2649 Hope that helps, -Sumit Chandel On Mon, Sep 21, 2009 at 9:58 AM, Sumit Chandel <[email protected]>wrote: > Hi akhil, > You should be able to accomplish what you're looking to do using the GWT > Gears library, as Etienne pointed out above. I recommend downloading the > library from the link below and checking out the DatabaseDemo packaged in > the samples directory once you extract the archive. The demo covers > persisting and retrieving objects back into widgets, or in your case, POJOs > for objects that you want to store and retrieve from the Gears client-side > database. > > GWT Gears download page: > http://code.google.com/p/gwt-google-apis/wiki/Downloads<http://code.google.com/p/gwt-google-apis/wiki/Downloads?tm=2> > > <http://code.google.com/p/gwt-google-apis/wiki/Downloads?tm=2>Hope that > helps, > -Sumit Chandel > > > On Thu, Sep 17, 2009 at 3:19 AM, akhil <[email protected]> wrote: > >> >> Hi, >> >> My intent is to use gears, but I have very complex objects (about 100 >> attributes). >> I don't want to create columns of all the 100 attributes (or prepare >> ORM). >> I just want to store 5 columns in the DB and serialize the object and >> store it as a string or blob. >> >> >> On Sep 16, 8:50 pm, Etienne Neveu <[email protected]> wrote: >> > Hi, >> > >> > I am not using Gears, but I heard of this project: >> > >> > http://code.google.com/p/gwt-google-apis/ >> > >> > You will mainly be interested in the Gears Library. Here is the >> > documentation: >> > >> > http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-google-apis. >> .. >> > >> > Regards, >> > >> > Etienne >> > >> > On 16 sep, 13:15,akhil<[email protected]> wrote: >> > >> > > Hi, >> > >> > > I am trying to serialize a gwt pojo on the client side and store in >> > > the DB of gears. >> > > Is there any way/api to do the serialization/deserialization? >> > >> > > Is is possible to invoke serialization api cleanly? >> > >> > >Akhil >> >> >> > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
