Browse Source

Exclude mongodb and data.mongodb namespaces from reflection contribution.

In some cases the users domain model may hold references to spring data or MongoDB specific types which should not be included in the reflection configuration as they are part of the static runtime hints configuration.

Closes #4248
Original pull request: #4249
pull/4352/head
Christoph Strobl 3 years ago committed by Mark Paluch
parent
commit
b160d0b2d7
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AotMongoRepositoryPostProcessor.java

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AotMongoRepositoryPostProcessor.java

@ -21,6 +21,7 @@ import org.springframework.data.mongodb.aot.MongoAotPredicates; @@ -21,6 +21,7 @@ import org.springframework.data.mongodb.aot.MongoAotPredicates;
import org.springframework.data.repository.config.AotRepositoryContext;
import org.springframework.data.repository.config.RepositoryRegistrationAotProcessor;
import org.springframework.data.util.TypeContributor;
import org.springframework.data.util.TypeUtils;
/**
* @author Christoph Strobl
@ -39,4 +40,13 @@ public class AotMongoRepositoryPostProcessor extends RepositoryRegistrationAotPr @@ -39,4 +40,13 @@ public class AotMongoRepositoryPostProcessor extends RepositoryRegistrationAotPr
lazyLoadingProxyAotProcessor.registerLazyLoadingProxyIfNeeded(type, generationContext);
});
}
@Override
protected void contributeType(Class<?> type, GenerationContext generationContext) {
if (TypeUtils.type(type).isPartOf("org.springframework.data.mongodb", "com.mongodb")) {
return;
}
super.contributeType(type, generationContext);
}
}

Loading…
Cancel
Save