public class CGLibLazyProxyFactory implements LazyProxyFactory {
private final CglibProxyFactory factory = new CglibProxyFactory();
public <T> T createProxy(final Class<T> targetClass, final Key<T> key, final DatastoreProvider p) {
final SerializableEntityObjectReference objectReference = new SerializableEntityObjectReference(targetClass, p, key);
final T backend = (T) new NonFinalizingHotSwappingInvoker(new Class[] {targetClass, Serializable.class}, factory, objectReference,
DelegationMode.SIGNATURE).proxy();
return Dispatching.proxy(targetClass, new Class[] {ProxiedEntityReference.class, targetClass, Serializable.class}).with(objectReference,