|
30 | 30 | import java.util.concurrent.locks.ReentrantReadWriteLock;
|
31 | 31 | import java.util.function.Predicate;
|
32 | 32 | import java.util.stream.Collectors;
|
| 33 | +import java.util.stream.StreamSupport; |
33 | 34 |
|
34 | 35 | import org.slf4j.Logger;
|
35 | 36 | import org.slf4j.LoggerFactory;
|
|
61 | 62 | import org.springframework.data.spel.ExtensionAwareEvaluationContextProvider;
|
62 | 63 | import org.springframework.data.util.ClassTypeInformation;
|
63 | 64 | import org.springframework.data.util.KotlinReflectionUtils;
|
| 65 | +import org.springframework.data.util.NullableWrapperConverters; |
64 | 66 | import org.springframework.data.util.Optionals;
|
65 | 67 | import org.springframework.data.util.Streamable;
|
66 | 68 | import org.springframework.data.util.TypeInformation;
|
@@ -483,6 +485,9 @@ protected boolean shouldCreatePersistentEntityFor(TypeInformation<?> type) {
|
483 | 485 | if (simpleTypeHolder.isSimpleType(type.getType())) {
|
484 | 486 | return false;
|
485 | 487 | }
|
| 488 | + if(NullableWrapperConverters.supports(type.getType())) { |
| 489 | + return false; |
| 490 | + } |
486 | 491 |
|
487 | 492 | return !KotlinDetector.isKotlinType(type.getType()) || KotlinReflectionUtils.isSupportedKotlinClass(type.getType());
|
488 | 493 | }
|
@@ -569,7 +574,19 @@ private void createAndRegisterProperty(Property input) {
|
569 | 574 | return;
|
570 | 575 | }
|
571 | 576 |
|
572 |
| - property.getPersistentEntityTypes().forEach(AbstractMappingContext.this::addPersistentEntity); |
| 577 | + StreamSupport.stream(property.getPersistentEntityTypes().spliterator(), false) |
| 578 | + .map(it -> { |
| 579 | + if(it.isNullableWrapper()) { |
| 580 | + return it.getActualType(); |
| 581 | + } |
| 582 | + return it; |
| 583 | + }) |
| 584 | + .filter(it -> { |
| 585 | + |
| 586 | + boolean shouldCreate = AbstractMappingContext.this.shouldCreatePersistentEntityFor(it); |
| 587 | + return shouldCreate; |
| 588 | + }) |
| 589 | + .forEach(AbstractMappingContext.this::addPersistentEntity); |
573 | 590 | }
|
574 | 591 |
|
575 | 592 | protected boolean shouldSkipOverrideProperty(P property) {
|
|
0 commit comments