Don't create PersistentEntity for Nullable wrapper type.

Original pull request: #2394.
Closes #2390.
This commit is contained in:
Christoph Strobl
2021-06-23 15:29:15 +02:00
committed by Mark Paluch
parent 26c2db248b
commit 1f77786d89
3 changed files with 31 additions and 1 deletions

View File

@@ -309,6 +309,10 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
return getComponentType();
}
if (isNullableWrapper()) {
return getComponentType();
}
return this;
}
@@ -384,6 +388,10 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
return getTypeArgument(Iterable.class, 0);
}
if(isNullableWrapper()) {
return getTypeArgument(rawType, 0);
}
List<TypeInformation<?>> arguments = getTypeArguments();
return arguments.size() > 0 ? arguments.get(0) : null;

View File

@@ -273,4 +273,9 @@ public interface TypeInformation<S> {
default boolean isSubTypeOf(Class<?> type) {
return !type.equals(getType()) && type.isAssignableFrom(getType());
}
default boolean isNullableWrapper() {
return NullableWrapperConverters.supports(getType());
}
}