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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -