Good day !
I've been using Hibernate for a while (2 years) and never tried developing using Hibernate and Lazy.
Ok, i'm using version 3.0.5 and i'm also experiencing some weird behaviours.
I'm under a JTA transaction on JBOSS 4.0.2.
I have an Object that belongs to a class called AutomaticActivity.
Class AutomaticActivity extends Activity.
This is the situation:
Hibernate.getClass(nextActivity)
.getSimpleName()
.equals("AutomaticActivity")) returns TRUE.
the Object nextActivity, if you look in the debugger shows:
Activity$$EnhancerByCGLIB$$blablabla
the toString() shows blabla.AutomaticActivity@3423e23
Everything fine so far. I proved that i have a AutomaticActivity used as Activity and proxied by CGLIB.
The question is: HOW DO I CAST THIS damn Object to my dear AutomaticActivity to get hold of specific fields?
I tried to initialize the proxy by Hibernate.initialize but it doesn't do anything.
I tried a straight cast even knowing it wouldn't work.
Is there a way to get a value from a specific field in the subclass using the proxied Object?
I'm sure i'm missing something in here.
I really appreciate any help
Thanks in advance,
:LuizDecaro.
PS: A workaround I found for this (ugly one) is to load an AutomaticActivity by the Id from my proxied Object from the DB.
|