When you write a Java app, you have to compile with a compiler (e.g. javac
) first. Some classfiles (*.class) are generated. There is the bytecode. The class file is a binary file that can be executed by a Java Virtual Machine.
You may want to read a classfile, modify a classfile (eg. for instrumentation) or create (generate) a completely new classfile. If you want to do this, a good library can make it easier. You don't have to care about the exact structure and many constants (e.g. opcodes).
CGLib homepage says that Hibernate "Uses cglib to generate proxies for persistent classes."