|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.database.querymanagers.generic.instrument.LazyLoadAccessorsBytecodeTransformer
public abstract class LazyLoadAccessorsBytecodeTransformer
This utility class will modify property accessors of classes that implement
the Constrained interface and add lazy loading for properties with
manyToOne constraints.
This is done by modifying the bytecode of the getters by checking if the
value that is returned is null, and in that case performing the
actual database call to fetch the property value. After that, the property
value is stored in a map that is stored in an added class field so that it
will not be fetched at subsequent calls of the getter. The setter is
modified to remove the values from this map when it is executed, so that
users can still provide their own values for the properties.
WARNING: this class is not supposed to be used directly, it is made public since the general RIFE EngineClassLoader has to be able to access it.
| Field Summary | |
|---|---|
static String |
GQM_VAR_NAME
The name of the synthentic class field that will be added so that the instance of the GenericQueryManager that restored the bean can be
used afterwards to lazily load the relations. |
static String |
LAZYLOADED_VAR_NAME
The name of the synthentic class field that will be added so that already restored lazy relations can be cached. |
| Constructor Summary | |
|---|---|
LazyLoadAccessorsBytecodeTransformer()
|
|
| Method Summary | |
|---|---|
static byte[] |
addLazyLoadToBytes(byte[] origBytes)
Performs the actual modification of the bean class's bytecode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GQM_VAR_NAME
GenericQueryManager that restored the bean can be
used afterwards to lazily load the relations.
public static final String LAZYLOADED_VAR_NAME
| Constructor Detail |
|---|
public LazyLoadAccessorsBytecodeTransformer()
| Method Detail |
|---|
public static byte[] addLazyLoadToBytes(byte[] origBytes)
origBytes - the bytes of the bean class that should be modified
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||