@@ -74,7 +74,7 @@ public class LazyLoadingProxyAotProcessor {
|
||||
} else {
|
||||
|
||||
Class<?> proxyClass = LazyLoadingProxyFactory.resolveProxyType(field.getType(),
|
||||
() -> LazyLoadingInterceptor.none());
|
||||
LazyLoadingInterceptor::none);
|
||||
|
||||
// see: spring-projects/spring-framework/issues/29309
|
||||
generationContext.getRuntimeHints().reflection().registerType(proxyClass,
|
||||
|
||||
@@ -72,7 +72,7 @@ public final class LazyLoadingProxyFactory {
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
* @param propertyType the type to proxy
|
||||
* @param interceptor the interceptor to be added.
|
||||
* @return the proxy type.
|
||||
@@ -93,20 +93,20 @@ public final class LazyLoadingProxyFactory {
|
||||
/**
|
||||
* Create the {@link ProxyFactory} for the given type, already adding required additional interfaces.
|
||||
*
|
||||
* @param propertyType the type to proxy
|
||||
* @return the proxy type.
|
||||
* @param targetType the type to proxy.
|
||||
* @return the prepared {@link ProxyFactory}.
|
||||
* @since 4.0.5
|
||||
*/
|
||||
public static ProxyFactory prepareFactory(Class<?> propertyType) {
|
||||
public static ProxyFactory prepareFactory(Class<?> targetType) {
|
||||
|
||||
ProxyFactory proxyFactory = new ProxyFactory();
|
||||
|
||||
for (Class<?> type : propertyType.getInterfaces()) {
|
||||
for (Class<?> type : targetType.getInterfaces()) {
|
||||
proxyFactory.addInterface(type);
|
||||
}
|
||||
|
||||
proxyFactory.addInterface(LazyLoadingProxy.class);
|
||||
proxyFactory.addInterface(propertyType);
|
||||
proxyFactory.addInterface(targetType);
|
||||
|
||||
return proxyFactory;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ import org.springframework.data.mongodb.core.mapping.DBRef;
|
||||
import org.springframework.javapoet.ClassName;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link LazyLoadingProxyAotProcessor}.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class LazyLoadingProxyAotProcessorUnitTests {
|
||||
|
||||
Reference in New Issue
Block a user