Skip to content

Commit b39a39d

Browse files
GH-2355 - Use correct target value.
1 parent eb5d024 commit b39a39d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ public boolean hasProcessedValue(Object value) {
211211
boolean processed = processedObjects.contains(valueToCheck) || processedObjectsAlias.containsKey(valueToCheck);
212212
// This can be the case the object has been loaded via an additional findXXX call
213213
// We can enforce sets and so on, but this is more user-friendly
214-
Class<?> typeOfValue = value.getClass();
214+
Class<?> typeOfValue = valueToCheck.getClass();
215215
if (!processed && mappingContext.hasPersistentEntityFor(typeOfValue)) {
216216
Neo4jPersistentEntity<?> entity = mappingContext.getRequiredPersistentEntity(typeOfValue);
217217
Neo4jPersistentProperty idProperty = entity.getIdProperty();
218-
Object id = idProperty == null ? null : entity.getPropertyAccessor(value).getProperty(idProperty);
218+
Object id = idProperty == null ? null : entity.getPropertyAccessor(valueToCheck).getProperty(idProperty);
219219
Optional<Object> alreadyProcessedObject = id == null ? Optional.empty() : processedObjects.stream()
220220
.filter(typeOfValue::isInstance)
221221
.filter(processedObject -> id.equals(entity.getPropertyAccessor(processedObject).getProperty(idProperty)))

0 commit comments

Comments
 (0)