File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/java/org/springframework/data/neo4j/core/mapping Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2020import java .util .HashSet ;
2121import java .util .Map ;
2222import java .util .Objects ;
23+ import java .util .Optional ;
2324import java .util .Set ;
2425import java .util .concurrent .locks .StampedLock ;
2526
@@ -215,12 +216,15 @@ public boolean hasProcessedValue(Object value) {
215216 Neo4jPersistentEntity <?> entity = mappingContext .getRequiredPersistentEntity (typeOfValue );
216217 Neo4jPersistentProperty idProperty = entity .getIdProperty ();
217218 Object id = idProperty == null ? null : entity .getPropertyAccessor (value ).getProperty (idProperty );
218- processed = id != null && processedObjects .stream ()
219+ Optional < Object > alreadyProcessedObject = id == null ? Optional . empty () : processedObjects .stream ()
219220 .filter (typeOfValue ::isInstance )
220- .anyMatch (processedObject -> id .equals (entity .getPropertyAccessor (processedObject ).getProperty (idProperty )));
221- if (processed ) { // Skip the show the next time around.
221+ .filter (processedObject -> id .equals (entity .getPropertyAccessor (processedObject ).getProperty (idProperty )))
222+ .findAny ();
223+ if (alreadyProcessedObject .isPresent ()) { // Skip the show the next time around.
224+ processed = true ;
225+ Long internalId = this .getInternalId (alreadyProcessedObject .get ());
222226 stamp = lock .tryConvertToWriteLock (stamp );
223- doMarkValueAsProcessed (valueToCheck , null );
227+ doMarkValueAsProcessed (valueToCheck , internalId );
224228 }
225229 }
226230 return processed ;
You can’t perform that action at this time.
0 commit comments