Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.3.
Hi everybody.
I've been using Hibernate from a couple of years already and i'm facing some problem hard to figure.
I have a class called User.
I fetch user using getSession().get(myClazz, id);
The results differ from time to time regarding the use of CGLIB.
For Instance:
Sometimes user gets loaded and the instance is User and sometimes user gets loaded and the instance is User$$EnhancedByCGLIB$$
My Question is:
Isn't this behaviour homogenious ?!?!?
I load an User instance and there is a mehod in my app that uses reflection to invoke all its "get"... methods. It happens that it tries to invoke automatically getCallback from CGlib and i don't want it to happen cos' i'm getting an IllegalArgumentException....
Actually, i didn't want this main node (usr) to get proxied by CGlib but only its properties and collections (as it always does, but somethimes the node comes proxied)
I could evict this class from being proxied by many means (ex final) but i'd have to it to every class...
PS: org.hibernate.Hibernate.initialize () DOES NOTHING TO MY OBJECT. Actually i never managed to make it work...
Cheers,
:Luiz>Decaro.