Class LazyLoadingProxyFactory

java.lang.Object
org.springframework.data.mongodb.core.convert.LazyLoadingProxyFactory

public final class LazyLoadingProxyFactory extends Object
ProxyFactory to create a proxy for PersistentProperty.getType() to resolve a reference lazily. NOTE: This class is intended for internal usage only.
Author:
Christoph Strobl, Mark Paluch
  • Constructor Details

  • Method Details

    • resolveProxyType

      public static Class<?> resolveProxyType(Class<?> propertyType, Supplier<LazyLoadingProxyFactory.LazyLoadingInterceptor> interceptor)
      Predict the proxy target type. This will advice the infrastructure to resolve as many pieces as possible in a potential AOT scenario without necessarily resolving the entire object.
      Parameters:
      propertyType - the type to proxy
      interceptor - the interceptor to be added.
      Returns:
      the proxy type.
      Since:
      4.0
    • prepareFactory

      public static ProxyFactory prepareFactory(Class<?> targetType)
      Create the ProxyFactory for the given type, already adding required additional interfaces.
      Parameters:
      targetType - the type to proxy.
      Returns:
      the prepared ProxyFactory.
      Since:
      4.0.5
    • createLazyLoadingProxy

      public Object createLazyLoadingProxy(MongoPersistentProperty property, DbRefResolverCallback callback, Object source)