hosted by
SourceForge.net Logo
| Home | News | Getting started | OverviewHibernate-GWT issues | FAQ | Thanks |

Getting started

hibernate4gwt allows different configurations, depending on your needs and constraints :

  • stateless (the default) : your server remains stateless and do not store any extra information. Your domain classes will have to inherit from LazyPojo to store lazy attributes.
  • dynamic proxy : a proxy is generated to handle lazy properties information both on server and client side. You just have to implement the Serializable interface and force GWT deferred binding on client side (see the associated guide for details)
  • stateful : lazy informations are not stored in the POJO but in HTTP session. So, your Domain classes do not need to have any technical inheritance, but your web server become stateful (sticky session).  
  • Java5 support (will probably disappear in future releases): because GWT 1.4 did not support Java5 syntax, hibernate4gwt allow you to dynamically clone yourJava 5 Domain classes to GWT compatible DTO (Java 1.4 syntax). Theses clone classes must have the same name than the Domain class (in a different package) and inherits from LazyPojo. On the other hand, hibernate4gwt will manager lazy properties for you and do not require any clone mapping file.

First of all, you have to decide in which configuration your application will run :

  • For a fresh new project, or if your can easily add a technical inheritance to your Domain classes, we recommend your to run in dynamic proxy or stateless mode
  • If you cannot (or do not wish to) add technical inheritance on them, you can run in dynamic proxy mode if they implements the Serializable interface (a common best practice), or in stateful mode otherwise.
  • At last, if you are using Java5 domain classes and GWT 1.4, you will have to use hibernate4gwt with explicit clone (called Java5 support) configuration.

Then follow the dedicated "Getting started" guide :

Finally, the Overview section explain the different possibilities and configuration allowed by the library.
Additionally, a simple sample application of each configuration is now available for download !

Copyright 2007. All Rights Reserved
 Last updated : 12 June, 2008