Skip to content

Commit 9a2408c

Browse files
GH-2355 - Use correct target value.
1 parent 900a60e commit 9a2408c

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

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

0 commit comments

Comments
 (0)