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


hibernate4gwt brings technical inheritance on your Hibernate POJO...

Wrong ! Only the 'stateless' mode implies that your entities must inherit from LazyGwtPojo. Using 'stateful' mode does not need any inheritance, and 'dynamic proxy' only implementing java.io.Serializable interface (yes, just like Hibernate...).

How do I migrate my project from release 1.0.X to 1.1 ?
  • In your project gwt.xml file : replace <inherits name='net.sf.hibernate4gwt.Hibernate4Gwt'/> with <inherits name='net.sf.hibernate4gwt.Hibernate4Gwt14'/> or <inherits name='net.sf.hibernate4gwt.Hibernate4Gwt15'/>, depending of the GWT version of the project

  • Stateless mode : replace LazyGwtPojo inheritance by net.sf.hibernate4gwt.core.pojo.java14.LazyPojo (or the equivalent java5 class)
  • Dynamic proxy mode : the ProxyClassMapper declaration is now mandatory (see relevant Getting Started guide for configuration details)

Why is my attribute <xxx> always null on the client side ?

The association is not loaded by Hibernate (it is lazy and handles only a proxy), that's why hibernate4gwt replaces it with null.
To solve this issue, you have to explicitly call the XXX getter on server-side (to force association loading from Hibernate) or to change your HQL request to "from MyItem as item inner join fetch item.xxx where ..."

I got a ClassCastException when integrating hibernate4gwt and GWT-SL...

It can be the case when in Java5 support mode. The right way to do is to declare the Spring service as an HibernateRemoteService and to set the beanManager property properly :
<bean id="<remoteService>" class="...">  
<property name="beanManager" ref="hibernateBeanManager"/>  

I got a ClassCastException when running hibernate4gwt on Jetty...

The problems comes from a Jetty ClassLoader issue (http://docs.codehaus.org/display/JETTY/Classloading)

Hopefully, it can be solved by adding the following line to the Jetty web application context XML file: 
     <Set name="parentLoaderPriority">true</Set> 

(Thanks to Tom Spencer for finding and solving the problem !)

Copyright 2008. All Rights Reserved
 Last updated : 1 June, 2008