Fix recative mapping creation.

Original Pull Request #1821
This commit is contained in:
Peter-Josef Meisch 2021-05-19 23:40:11 +02:00 committed by GitHub
parent 0836411d45
commit 5ed655e0aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -210,6 +210,7 @@ abstract class AbstractDefaultIndexOperations implements IndexOperations {
// load mapping specified in Mapping annotation if present
Mapping mappingAnnotation = AnnotatedElementUtils.findMergedAnnotation(clazz, Mapping.class);
if (mappingAnnotation != null) {
String mappingPath = mappingAnnotation.mappingPath();

View File

@ -183,7 +183,11 @@ class DefaultReactiveIndexOperations implements ReactiveIndexOperations {
Mapping mappingAnnotation = AnnotatedElementUtils.findMergedAnnotation(clazz, Mapping.class);
if (mappingAnnotation != null) {
return loadDocument(mappingAnnotation.mappingPath(), "@Mapping");
String mappingPath = mappingAnnotation.mappingPath();
if (hasText(mappingPath)) {
return loadDocument(mappingAnnotation.mappingPath(), "@Mapping");
}
}
String mapping = new MappingBuilder(converter).buildPropertyMapping(clazz);