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