Polishing for full type information on RepositoryMetadata.

Avoid leaking internals from TypeInformation by exposing a ….toTypeDescriptor() method in TypeInformation directly. This causes the ResolvableType handling to become an implementation detail within ClassTypeInformation and avoid client code to manually deal with both ResolvableType and TypeDescriptor creation.

Changed MethodLookups back to use the resolved domain types as the advanced generics resolutions seems not to be needed here and we can avoid

Fixes #2518.
This commit is contained in:
Oliver Drotbohm
2022-03-29 18:09:43 +02:00
parent 58ed9ce211
commit 3e9451c939
12 changed files with 117 additions and 109 deletions

View File

@@ -28,7 +28,6 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -305,7 +304,8 @@ class RepositoriesUnitTests {
var domainType = super.getDomainType().getName().concat("Entity");
try {
this.domainType = ClassTypeInformation.from(ClassUtils.forName(domainType, CustomRepositoryMetadata.class.getClassLoader()));
this.domainType = ClassTypeInformation
.from(ClassUtils.forName(domainType, CustomRepositoryMetadata.class.getClassLoader()));
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -313,7 +313,7 @@ class RepositoriesUnitTests {
@Override
public TypeInformation<?> getDomainTypeInformation() {
return this.domainType;
return domainType == null ? super.getDomainTypeInformation() : domainType;
}
@Override