DATACMNS-1299 - QueryExecutionsConverters now don't unwrap custom Iterable implementations.

Instead of a simple check for assignability from Iterable, we now properly use TypeInformation.isCollectionLike(), which checks for Iterable equality or assignability of collections or arrays as well as an explicit check for Slice as that is needed to properly unwrap Page instances and Slices themselves. That prevents custom domain types implementing Iterable from being unwrapped into their element types.
This commit is contained in:
Oliver Gierke
2018-04-16 16:00:43 +02:00
parent 5f37a3af95
commit 5986b4b7af
3 changed files with 39 additions and 1 deletions

View File

@@ -300,7 +300,8 @@ public abstract class QueryExecutionConverters {
Class<?> rawType = type.getType();
boolean needToUnwrap = Iterable.class.isAssignableFrom(rawType) //
boolean needToUnwrap = type.isCollectionLike() //
|| Slice.class.isAssignableFrom(rawType) //
|| rawType.isArray() //
|| supports(rawType) //
|| Stream.class.isAssignableFrom(rawType);