|
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; |
@@ -320,15 +321,20 @@ public <T> Mono<ExecutableQuery<T>> toExecutableQuery(Class<T> domainType, |
320 | 321 | return createExecutableQuery(domainType, null, queryFragmentsAndParameters); |
321 | 322 | } |
322 | 323 |
|
| 324 | + private Object convertIdValues(@Nullable Neo4jPersistentProperty idProperty, @Nullable Object idValues) { |
323 | 325 |
|
324 | | - private Object convertIdValues(@Nullable Neo4jPersistentProperty idProperty, Object idValues) { |
325 | | - |
326 | | - if (((Neo4jPersistentEntity<?>) idProperty.getOwner()).isUsingInternalIds()) { |
| 326 | + if (idProperty != null && ((Neo4jPersistentEntity<?>) idProperty.getOwner()).isUsingInternalIds()) { |
327 | 327 | return idValues; |
328 | 328 | } |
329 | 329 |
|
330 | | - return neo4jMappingContext.getConversionService().writeValue(idValues, |
331 | | - ClassTypeInformation.from(idValues.getClass()), idProperty == null ? null : idProperty.getOptionalConverter()); |
| 330 | + if (idValues != null) { |
| 331 | + return neo4jMappingContext.getConversionService().writeValue(idValues, ClassTypeInformation.from(idValues.getClass()), idProperty == null ? null : idProperty.getOptionalConverter()); |
| 332 | + } else if (idProperty != null) { |
| 333 | + return neo4jMappingContext.getConversionService().writeValue(idValues, idProperty.getTypeInformation(), idProperty.getOptionalConverter()); |
| 334 | + } else { |
| 335 | + // Not much we can convert here |
| 336 | + return Values.NULL; |
| 337 | + } |
332 | 338 | } |
333 | 339 |
|
334 | 340 | @Override |
|
0 commit comments