Numerous times I've wanted to see the contents of OpenJPA generated byte
code and it was always a painful process. Today I came across some code that
I found to be very useful.

Code:
System.setProperty("org.apache.openjpa.enhance.ManagedClassSubclasser.dumpBytecodes",
"true");
Project p = new Project();
ManagedClassSubclasser.debugBytecodes(p.loadClass(object.getClass()));

SystemOut:
Writing to C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\.....class

This will result in a .class file being dumped which then can be decompiled.
Note, I had to make ManagedClassSubclasser.debugBytecodes a public method
for this to work...
-- 
Thanks,
Rick

Reply via email to