it.amattioli.dominate.lazy
Class LazyEntity<I extends Serializable>
java.lang.Object
it.amattioli.dominate.lazy.LazyEntity<I>
- Type Parameters:
I -
- All Implemented Interfaces:
- net.sf.cglib.proxy.Callback, net.sf.cglib.proxy.MethodInterceptor
public class LazyEntity<I extends Serializable>
- extends Object
- implements net.sf.cglib.proxy.MethodInterceptor
A CGLib method interceptor for lazy loaded entities.
Using the static newInstance(Class, Serializable) method you can create instances
of an entity class whose state can be loaded from the repository only when needed.
- Author:
- andrea
|
Method Summary |
Object |
intercept(Object object,
Method method,
Object[] args,
net.sf.cglib.proxy.MethodProxy methodProxy)
|
static
|
newInstance(Class<T> entityClass,
I id)
Create a new instance of an entity class whose state can be loaded from the repository
only when needed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LazyEntity
public LazyEntity(Class<? extends Entity<I>> entityClass,
I id)
newInstance
public static <I extends Serializable,T extends Entity<I>> T newInstance(Class<T> entityClass,
I id)
- Create a new instance of an entity class whose state can be loaded from the repository
only when needed.
- Type Parameters:
I - The class of the entity idT - The class of the entity- Parameters:
entityClass - The class object of the entityid - The entity id
- Returns:
intercept
public Object intercept(Object object,
Method method,
Object[] args,
net.sf.cglib.proxy.MethodProxy methodProxy)
throws Throwable
- Specified by:
intercept in interface net.sf.cglib.proxy.MethodInterceptor
- Throws:
Throwable
Copyright © 2011. All Rights Reserved.