|
19 | 19 | import static org.neo4j.cypherdsl.core.Cypher.asterisk; |
20 | 20 | import static org.neo4j.cypherdsl.core.Cypher.parameter; |
21 | 21 |
|
| 22 | +import org.neo4j.driver.Values; |
22 | 23 | import org.springframework.data.neo4j.core.mapping.IdDescription; |
23 | 24 | import reactor.core.publisher.Flux; |
24 | 25 | import reactor.core.publisher.Mono; |
@@ -307,15 +308,20 @@ public <T> Mono<ExecutableQuery<T>> toExecutableQuery(Class<T> domainType, |
307 | 308 | return createExecutableQuery(domainType, null, queryFragmentsAndParameters); |
308 | 309 | } |
309 | 310 |
|
| 311 | + private Object convertIdValues(@Nullable Neo4jPersistentProperty idProperty, @Nullable Object idValues) { |
310 | 312 |
|
311 | | - private Object convertIdValues(@Nullable Neo4jPersistentProperty idProperty, Object idValues) { |
312 | | - |
313 | | - if (((Neo4jPersistentEntity<?>) idProperty.getOwner()).isUsingInternalIds()) { |
| 313 | + if (idProperty != null && ((Neo4jPersistentEntity<?>) idProperty.getOwner()).isUsingInternalIds()) { |
314 | 314 | return idValues; |
315 | 315 | } |
316 | 316 |
|
317 | | - return neo4jMappingContext.getConversionService().writeValue(idValues, |
318 | | - TypeInformation.of(idValues.getClass()), idProperty == null ? null : idProperty.getOptionalConverter()); |
| 317 | + if (idValues != null) { |
| 318 | + return neo4jMappingContext.getConversionService().writeValue(idValues, TypeInformation.of(idValues.getClass()), idProperty == null ? null : idProperty.getOptionalConverter()); |
| 319 | + } else if (idProperty != null) { |
| 320 | + return neo4jMappingContext.getConversionService().writeValue(idValues, idProperty.getTypeInformation(), idProperty.getOptionalConverter()); |
| 321 | + } else { |
| 322 | + // Not much we can convert here |
| 323 | + return Values.NULL; |
| 324 | + } |
319 | 325 | } |
320 | 326 |
|
321 | 327 | @Override |
|
0 commit comments