DATACMNS-578 - Speed up instance creation by generating factory classes with ASM.

Introduced BytecodeGeneratingEntityInstantiator which dynamically generates classes to speed up the dynamic instantiation of objects. Since we cannot support every use case with byte code generation we gracefully fallback to the ReflectiveEntityInstantiator.

BytecodeGeneratingEntityInstantiator has support for unboxing of constructor parameters and more robust handling for cases where we cannot generate a custom ObjectInstantiator.

Original pull request: #98.
This commit is contained in:
Thomas Darimont
2014-10-14 10:22:04 +02:00
committed by Oliver Gierke
parent 48966b50d6
commit 1b9cdc941f
6 changed files with 914 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ public interface PersistentEntity<T, P extends PersistentProperty<P>> {
* Returns the {@link PreferredConstructor} to be used to instantiate objects of this {@link PersistentEntity}.
*
* @return {@literal null} in case no suitable constructor for automatic construction can be found. This usually
* indicates that the instantiation of the object of tthat persistent entity is done through either a customer
* indicates that the instantiation of the object of that persistent entity is done through either a customer
* {@link EntityInstantiator} or handled by custom conversion mechanisms entirely.
*/
PreferredConstructor<T, P> getPersistenceConstructor();