|
41 | 41 | import org.neo4j.cypherdsl.core.Node; |
42 | 42 | import org.neo4j.cypherdsl.core.Statement; |
43 | 43 | import org.neo4j.cypherdsl.core.renderer.Renderer; |
44 | | -import org.neo4j.driver.Value; |
45 | 44 | import org.neo4j.driver.exceptions.NoSuchRecordException; |
46 | 45 | import org.neo4j.driver.summary.ResultSummary; |
47 | 46 | import org.neo4j.driver.summary.SummaryCounters; |
@@ -618,24 +617,6 @@ private <T> T processNestedRelations(Neo4jPersistentEntity<?> sourceEntity, Pers |
618 | 617 | return (T) propertyAccessor.getBean(); |
619 | 618 | } |
620 | 619 |
|
621 | | - private <Y> Long queryRelatedNode(Object entity, Neo4jPersistentEntity<?> targetNodeDescription, |
622 | | - @Nullable String inDatabase) { |
623 | | - |
624 | | - Neo4jPersistentProperty requiredIdProperty = targetNodeDescription.getRequiredIdProperty(); |
625 | | - PersistentPropertyAccessor<Object> targetPropertyAccessor = targetNodeDescription.getPropertyAccessor(entity); |
626 | | - Object idValue = targetPropertyAccessor.getProperty(requiredIdProperty); |
627 | | - |
628 | | - return neo4jClient.query(() -> |
629 | | - renderer.render(cypherGenerator.prepareMatchOf(targetNodeDescription, |
630 | | - targetNodeDescription.getIdExpression().isEqualTo(parameter(Constants.NAME_OF_ID))) |
631 | | - .returning(Constants.NAME_OF_INTERNAL_ID) |
632 | | - .build()) |
633 | | - ) |
634 | | - .in(inDatabase).bindAll(Collections.singletonMap(Constants.NAME_OF_ID, |
635 | | - neo4jMappingContext.getConversionService().convert(idValue, Value.class))) |
636 | | - .fetchAs(Long.class).one().get(); |
637 | | - } |
638 | | - |
639 | 620 | private <Y> Long saveRelatedNode(Object entity, NodeDescription targetNodeDescription, @Nullable String inDatabase) { |
640 | 621 |
|
641 | 622 | DynamicLabels dynamicLabels = determineDynamicLabels(entity, (Neo4jPersistentEntity) targetNodeDescription, |
|
0 commit comments