Package org.hibernate.bytecode
This package defines the API for plugging in bytecode libraries for usage by Hibernate. Hibernate uses these bytecode libraries in three scenarios:
- Reflection optimization - to speed up the performance of POJO entity and component conctruction and field/property access
- Proxy generation - runtime building of proxies used for deferred loading of lazy entities
- Field-level interception - build-time instrumentation of entity classes for the purpose of intercepting field-level access (read/write) for both lazy loading and dirty tracking.
Currently, both CGLIB and Javassist are supported out-of-the-box.
Note that for field-level interception, simply plugging in a new BytecodeProvider
is not enough for Hibernate to be able to recognize new providers. You would additionally
need to make appropriate code changes to the
invalid reference
org.hibernate.intercept.HelperSessionFactory.
Note that in the current form the ability to specify a different bytecode provider is actually considered a global settings (global to the JVM).
-
ClassDescriptionBasic implementation of the
ClassTransformercontract.A proxy factory for "basic proxy" generationContract for providers of bytecode services to Hibernate.A persistence provider provides an instance of this interface to the PersistenceUnitInfo.addTransformer method.A specialized classloader which performs bytecode enhancement on class definitions as they are loaded into the classloader scope.An interface for factories ofproxy factoryinstances.Represents reflection optimization for a particular class.Represents optimized entity property access.Represents optimized entity instantiation.