Hi Karthik, Yet another approach to integrate GWT with Hibernate is to use intermediary DTOs (Data Transfer Objects). You'll find this solution mentioned in other threads on this forum relating to using Hibernate with GWT.
As mentioned earlier, since Hibernate uses types like PersistentSet and its own inheritance schema for java.sql.Timestamp / java.util.Date, it can't be serialized over GWT RPC. Instead of returning these directly, you can populate DTOs from your Hibernate objects that are serializable and return those over the wire. Hope that helps, -Sumit Chandel On Mon, Feb 2, 2009 at 7:30 AM, Addy <[email protected]> wrote: > > I have been using hibernate in a GWT project for a long time without > any external library. > There are only a few things you need to keep in mind and you wont have > any trouble > 1. Dont use Lazy loading. You should shut off lazy="false" if using > xml config > 2. Hibernate convert sets to PersistentSet so you need to convert it > back, > I usually write a dehibernate method in my dao where I create a new > set and use an iterator to iterate through all values in persistent > set and put them in a plain set. > > Let me know if this works. It is a lot faster than using other tools > Addy > http://checkAppointments.com > > > On Jan 30, 12:50 pm, "Karthik Karuppannan" <[email protected]> > wrote: > > GWT is not able to serialize the PersistentSet in Hibernate POJO objects > > and throwing below errors. > > > > Caused by: com.google.gwt.user.client.rpc.SerializationException: Type > > 'org.hibernate.collection.PersistentSet' was not assignable to > > 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom > > field serializer. For security purposes, this type will not be > > serialized. > > > > at > > > com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSeri > > alize(LegacySerializationPolicy.java:140)... > > > > I googled around for options but I could not find any solution other than > > the hibernate4gwt (now Gilead). I am not comfortable using it as per > steps > > described athttp:// > hibernate4gwt.sourceforge.net/getting_started_stateless.html(I am > > not sure if there is any updated version to this). I need to modify my > > domain classes, remote services, spring context configurations, etc. > > > > Is there any other alternate solution? I joined just now and this is my > > first post. So, I am sorry if I am asking a repeated question for a known > > solution. > > > > ~ regards, > > > > Karthik Karuppannan > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
