Search code examples
jsonhibernategwtdozergilead

Passing (Smart) GWT Overlay Types From Client To Server & Use Of Hibernate Persistence


Our project makes use of gilead to pass model objects to the client side using the GWT RPC model. The problem we face is that serializing to and from JSON on the client side for procesing is becoming more of an issue as our model grows / changes.

I am considering using Overlay Types as our client side representation of our entity objects.

What is the general approach for this when using it in conjunction with Hibernate, do you have to recreate the objects server side and then persist ?

Would it be possible to pass the client side object back and then use Dozer to map to the server side Entity ?

Thanks, Andros


Solution

  • With Gilead and GWT-RPC, you don't need to translate your objects to JSON at all. You just pass your objects (entities which extend net.sf.gilead.pojo.gwt.LightEntity) to the client, and use them directly on the client. You can also send these objects from the client to the server. I would recommend to look at the Gilead example in this article:

    http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html

    You can download the source code here:

    http://google-web-toolkit.googlecode.com/files/gwt_hibernate_gilead.zip