annotations - introspection - table name of an object managed by Hibernate (JavassistLazyInitializer) -
i want through introspection table name of object managed hibernate (in lazy).
my object contains "org.hibernate.proxy.pojo.javassist.javassistlazyinitializer" in property handler.
my object of type "mypackage.myobjectdo_ _javassist_2 $ $" , not contain annotations class "mypackage.myobjectdo" contains (i seek annotation javax.persistence.table).
how can do?
i want through introspection table name of object managed hibernate (in lazy).
this unusual need (hibernate supposed abstract away) let's need it...
my object of type (...) , not contain annotations class (...) contains
you'll have unproxy proxy. here little method a previous answer (from bozho):
public static <t> t initializeandunproxy(t var) { if (var == null) { throw new illegalargumentexception("passed argument null"); } hibernate.initialize(var); if (var instanceof hibernateproxy) { var = (t) ((hibernateproxy) var).gethibernatelazyinitializer() .getimplementation(); } return var; }
see converting proxy object real thing in hibernate forums.
Comments
Post a Comment