Module spring.data.mongodb
Class LazyLoadingProxyFactory
java.lang.Object
org.springframework.data.mongodb.core.convert.LazyLoadingProxyFactory
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateLazyLoadingProxy(MongoPersistentProperty property, DbRefResolverCallback callback, Object source) static ProxyFactoryprepareFactory(Class<?> targetType) Create theProxyFactoryfor the given type, already adding required additional interfaces.static Class<?>resolveProxyType(Class<?> propertyType, Supplier<LazyLoadingProxyFactory.LazyLoadingInterceptor> interceptor) Predict the proxy target type.
-
Constructor Details
-
LazyLoadingProxyFactory
-
-
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 proxyinterceptor- the interceptor to be added.- Returns:
- the proxy type.
- Since:
- 4.0
-
prepareFactory
Create theProxyFactoryfor 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)
-