Don't create PersistentEntity for Nullable wrapper type.
Original pull request: #2394. Closes #2390.
This commit is contained in:
committed by
Mark Paluch
parent
26c2db248b
commit
1f77786d89
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user