gwt 2.0.x gilead hibernate tutorial

UPDATE: 05.08.2013

If you came to this blog in order to learn how to manage Data transfer from Server layer to the GWT layer, please note that since 2010 GWT team has introduced new and comfortable way to do that. The mechanism is called Request Factory and you can read more about it here:

If you run to any problems you can check my other blog post where I explain how the most common update/save workflow works in Request Factory: exciting life of entity proxies.

UPDATE: 14.10.2010 – official GWT 2.1 .RC release with Request Factory

When I was writing this tutorial, there was no official GWT support for sending Entities from server to client side.  Since GWT 2.1.rc is officially released the suggested way to connect JPA or Hibernate with GWT is to use RequestFactory. Read more on :
If you are interested in gilead with gwt 2.0.4 anyway you can still read my tutorial:)

GWT Gilead tutorial – what for?

Writing client code in GWT is very nice way to produce user layout fast and easy. But when you need to get some data from the database.. debate begins. GWT has some restrictions which don’t allow you to use every framework in  every way you want. Especially if you are using object relational mapping frameworks you need to make some workaround if you want to send your entities to the client side.  E.g. you can use Data Transfer Objects (DTO) – which in some cases may be good because they encourage you to send only this information which you really need to show. But still you have to take care of cloning all your entities..
Another solution is using Gilead framework, which takes care about serializing your entities also handling lazy loaded parameters. There are some examples on the web how to use it but I haven’t found any example with the newest version of gilead and gwt as well with annotated hibernate entities.  That is why I have decided to share the steps I have made to configure such a project.
I will present you already working GWT project example which doesn’t have Gilead support. Then I will describe steps you need to take to add Gilead framework to it. If you are lazy you can just download the final version of project which is configured and ready to go.