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
@@ -215,12 +216,15 @@ public boolean hasProcessedValue(Object value) {
215
216
Neo4jPersistentEntity <?> entity = mappingContext .getRequiredPersistentEntity (typeOfValue );
216
217
Neo4jPersistentProperty idProperty = entity .getIdProperty ();
217
218
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 ()
219
220
.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 ());
222
226
stamp = lock .tryConvertToWriteLock (stamp );
223
- doMarkValueAsProcessed (valueToCheck , null );
227
+ doMarkValueAsProcessed (valueToCheck , internalId );
224
228
}
225
229
}
226
230
return processed ;
You can’t perform that action at this time.
0 commit comments