Skip to content

Commit 910c08a

Browse files
committed
GH-2246 - Deterministic mapping of records with mixed results.
If a record contains more than just a node, for example a node and an additional field, the labels were ignored. The default behaviour was to take the nodes provided by the node description to instantiate the entity class. This can lead to problems with abstract base classes, because the detailed information which concrete implementation to choose from was more or less random. Closes #2246
1 parent 19d1fc7 commit 910c08a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/springframework/data/neo4j/core/mapping/DefaultNeo4jEntityConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ private static MapAccessor mergeRootNodeWithRecord(Node node, MapAccessor record
220220
Map<String, Object> mergedAttributes = new HashMap<>(node.size() + record.size() + 1);
221221

222222
mergedAttributes.put(Constants.NAME_OF_INTERNAL_ID, node.id());
223+
mergedAttributes.put(Constants.NAME_OF_LABELS, node.labels());
223224
mergedAttributes.putAll(node.asMap(Function.identity()));
224225
mergedAttributes.putAll(record.asMap(Function.identity()));
225226

0 commit comments

Comments
 (0)