DATAREST-897 - Switched to use approximated Map in NestedEntitySerializer.

We now use CollectionFactory.createApproximateMap(…) to avoid picking up persistence technology specific Map implementations that might cause issues (e.g. requiring a Session in the case of Hibernate).

Related tickets: DATAREST-864.
This commit is contained in:
Oliver Gierke
2016-09-19 07:09:04 +02:00
parent 95d62fb18c
commit 759ba860dc

View File

@@ -357,7 +357,7 @@ public class PersistentEntityJackson2Module extends SimpleModule {
} else if (value instanceof Map) {
Map<?, ?> source = (Map<?, ?>) value;
Map<Object, Object> resources = CollectionFactory.createMap(value.getClass(), source.size());
Map<Object, Object> resources = CollectionFactory.createApproximateMap(value.getClass(), source.size());
for (Entry<?, ?> entry : source.entrySet()) {
resources.put(entry.getKey(), toResource(entry.getValue()));