From 2557d41c9a0be751f83e187976c7978e5801c344 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 6 Dec 2022 14:46:21 +0100 Subject: [PATCH 1/2] prepare issue branch. --- pom.xml | 4 ++-- spring-data-mongodb-benchmarks/pom.xml | 2 +- spring-data-mongodb-distribution/pom.xml | 2 +- spring-data-mongodb/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index b78554647f..e38c58884b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-mongodb-parent - 4.1.0-SNAPSHOT + 4.1.x-GH-4248-SNAPSHOT pom Spring Data MongoDB @@ -26,7 +26,7 @@ multi spring-data-mongodb - 3.1.0-SNAPSHOT + 3.1.x-2744-SNAPSHOT 4.8.0 ${mongo} 1.19 diff --git a/spring-data-mongodb-benchmarks/pom.xml b/spring-data-mongodb-benchmarks/pom.xml index 1b2a1390e6..c1477d9ae2 100644 --- a/spring-data-mongodb-benchmarks/pom.xml +++ b/spring-data-mongodb-benchmarks/pom.xml @@ -7,7 +7,7 @@ org.springframework.data spring-data-mongodb-parent - 4.1.0-SNAPSHOT + 4.1.x-GH-4248-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb-distribution/pom.xml b/spring-data-mongodb-distribution/pom.xml index 8db8d798fb..583c239388 100644 --- a/spring-data-mongodb-distribution/pom.xml +++ b/spring-data-mongodb-distribution/pom.xml @@ -15,7 +15,7 @@ org.springframework.data spring-data-mongodb-parent - 4.1.0-SNAPSHOT + 4.1.x-GH-4248-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index 9a57f7eb52..8a7cdb8922 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -13,7 +13,7 @@ org.springframework.data spring-data-mongodb-parent - 4.1.0-SNAPSHOT + 4.1.x-GH-4248-SNAPSHOT ../pom.xml From e7e67809a8b2dc3c95059bebe66bd7d2a80549ad Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Wed, 7 Dec 2022 13:46:27 +0100 Subject: [PATCH 2/2] 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. --- .../aot/AotMongoRepositoryPostProcessor.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AotMongoRepositoryPostProcessor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AotMongoRepositoryPostProcessor.java index 6f7e0cf429..4cf79c8302 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AotMongoRepositoryPostProcessor.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/AotMongoRepositoryPostProcessor.java @@ -21,6 +21,7 @@ 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 @@ protected void contribute(AotRepositoryContext repositoryContext, GenerationCont 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); + } }