man, 09,.01.2006 kl. 19.44 +0100, skrev Ted Steen: > there is a problem with the HibernateSqueezer ( > http://wiki.apache.org/jakarta-tapestry/HibernateTapestrySqueezer ) > > sometimes Hibernate extends the persistent classes, this probably has > something to do with caching.. anyway, this is an example of what > data.getClass().getCanonicalName() > could return; > a.b.c.PersistentClass$$EnhancerByCGLIB$$971b2e13 > > so it is going to unsqueeze to null... > > this seems like a rather common problem (it should have happend to > them who is using the HibernateSqueezer) anyone know a solution? >
We fixed this problem with a rather cruel hack, but it works: In unsqueeze: ... psf String CGLIB_TOKEN = "CGLIB"; psfs CGLIB_ADDED_SIGNS ="$"; ... public Object unsqueeze(DataSqueezer squeezer, String string) { ... String classname = parts[1]; if(classname.indexOf(CGLIB_TOKEN) > 0) classname = classname.substring(0, classname.indexOf(CGLIB_ADDED_SIGNS)); ... } We have modified the squeezer example in the wiki a bit, but you should be able to get the general idea of it. Dunno what will happen if we turn of CGLib enhancement in Hibernate though. Not tested yet :-) HTH.
signature.asc
Description: Dette er en digitalt signert meldingsdel