This content has been marked as final.
Show 6 replies
-
1. Re: Class type issue
quilian Jul 4, 2007 9:38 AM (in response to lcoetzee)
Does anybody have an idea of why only one of these would be Topic_$$_javassist_227 while the others are the correct type ?
No need to worry, your class has only been bytecode-manipulated by Seam(I guess) with javassist, which is used to enrich your class with additional features:
http://labs.jboss.com/javassist/ -
2. Re: Class type issue
lcoetzee Jul 4, 2007 11:17 AM (in response to lcoetzee)Hmmm.. but the problem comes in later. I do
<f:subview rendered="#{currTopic.class.name eq 'csir.structure.par.CMSTopic'}"> bla bla bla
Which works very well to display a specific thing based on the class type. Issue is that because of this manipulation, those that have been manipulated are of the wrong type....
So why are only some of them manipulated ?
Very curious.
L -
3. Re: Class type issue
pmuir Jul 8, 2007 10:17 AM (in response to lcoetzee)I would guess this is Hibernate using proxies to support lazy fetching. Take a look at Seam.getEntityClass for how we deal with this in Seam (its a very simple deproxy). You could wrap this up in a facelets function...
-
4. Re: Class type issue
lcoetzee Jul 11, 2007 5:02 AM (in response to lcoetzee)I have made some progress with your suggestion.. (e.g. implemented a facelets function). Unfortunately the getEntityClass returns the base class and not the inherited class.. e.g
Executing deproxy on csir.structure.par.Topic_$$_javassist_226 -->csir.structure.par.Topic
In this case the deproxy should have shownExecuting deproxy on csir.structure.par.Topic_$$_javassist_226 -->csir.structure.par.CMSTopic
Any idea of how to get the inherited type out of the proxied class ?
Thanks
L -
5. Re: Class type issue
gavin.king Jul 11, 2007 5:13 AM (in response to lcoetzee)There is a method call in Hibernate, somewhere, perhaps a static method on the class named Hibernate.
-
6. Re: Class type issue
lcoetzee Jul 11, 2007 5:24 AM (in response to lcoetzee)Hmm... trying:
Class<?> deproxied = org.hibernate.Hibernate.getClass(clazz);
results in :Executing deproxy on csir.structure.par.Topic_$$_javassist_21 -->java.lang.Class
which is not quite what I had in mind ;-). I need to get the subclass of Topic.
L