Fixed issue with transformer with map of <String,List>
@@ -5,6 +5,9 @@ import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultInternal;
import java.util.Map;
+import java.util.Spliterator;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
/**
* Created by Enrico Risa on 24/01/17.
@@ -24,9 +27,17 @@ public class MapTransformer implements OResultTransformer<Map<Object, Object>> {
if (transformer.doesHandleResult(val)) {
internal.setProperty(key.toString(), transformer.toResult(val));
} else {
+
+ if(val instanceof Iterable){
+ Spliterator spliterator = ((Iterable) val).spliterator();
+ Object collect = StreamSupport.stream(spliterator, false).map((e) -> this.transformer.toResult(e)).collect(Collectors.toList());
+ internal.setProperty(key.toString(), collect);
+ }else {
internal.setProperty(key.toString(), val);
}
+ }
+
});
return internal;
}
