I'm working a lot with java reflection, and i'm using a map to store metadata from each bean in the application. I use the className as a key, so, the problem is that when a ask for the className of a bean).
bean.getClass().getName()
I can get two different results, depending if the bean is lazy loaded or not (some relations are lazy, some aren't, but i want to work with both of them.
For example, the Class:
package com.factorit.beans;<br>
public class Task implements java.io.Serializable {
If called in a normal loaded object, it returns:
com.factorit.beans.Task
but if called in a lazy initialized object, it returns
com.factorit.beans.Task$$EnhancerByCGLIB$$f9d61939
I was wondering if there is a way to get this, or if I have to parse the String.
Thank you so much for any help or advice.
EDIT: Just to add some info: My Lazy annotattions look like this:
@javax.persistence.ManyToOne(fetch = javax.persistence.FetchType.LAZY)
and I'm using Struts 2.1.8.1, Hibernate 3 and Spring 2.5.6.