Skip to content

Commit b160d0b

Browse files
christophstroblmp911de
authored andcommitted
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
1 parent c8b3794 commit b160d0b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.springframework.data.repository.config.AotRepositoryContext;
2222
import org.springframework.data.repository.config.RepositoryRegistrationAotProcessor;
2323
import org.springframework.data.util.TypeContributor;
24+
import org.springframework.data.util.TypeUtils;
2425

2526
/**
2627
* @author Christoph Strobl
@@ -39,4 +40,13 @@ protected void contribute(AotRepositoryContext repositoryContext, GenerationCont
3940
lazyLoadingProxyAotProcessor.registerLazyLoadingProxyIfNeeded(type, generationContext);
4041
});
4142
}
43+
44+
@Override
45+
protected void contributeType(Class<?> type, GenerationContext generationContext) {
46+
47+
if (TypeUtils.type(type).isPartOf("org.springframework.data.mongodb", "com.mongodb")) {
48+
return;
49+
}
50+
super.contributeType(type, generationContext);
51+
}
4252
}

0 commit comments

Comments
 (0)