From 607a45fa0a40d1f3a0bb5bd128e5f2a6fe5ab7c2 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 6 Sep 2021 10:17:59 +0200 Subject: [PATCH] GH-2343 - Adapt to changes in FluentQuery. See: #2343 Original pull request: #2360. --- .../neo4j/repository/query/FetchableFluentQueryByExample.java | 4 ++-- .../repository/query/FetchableFluentQueryByPredicate.java | 4 ++-- .../imperative/QuerydslNeo4jPredicateExecutorIT.java | 4 ++-- .../data/neo4j/integration/imperative/RepositoryIT.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByExample.java b/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByExample.java index b93b629c6..c87dc8bd5 100644 --- a/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByExample.java +++ b/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByExample.java @@ -110,7 +110,7 @@ final class FetchableFluentQueryByExample extends FluentQuerySupport im } @Override - public R one() { + public R oneValue() { return findOperation.find(example.getProbeType()) .as(resultType) @@ -120,7 +120,7 @@ final class FetchableFluentQueryByExample extends FluentQuerySupport im } @Override - public R first() { + public R firstValue() { List all = all(); return all.isEmpty() ? null : all.get(0); diff --git a/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByPredicate.java b/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByPredicate.java index c4319b849..d880d712c 100644 --- a/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByPredicate.java +++ b/src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByPredicate.java @@ -112,7 +112,7 @@ final class FetchableFluentQueryByPredicate extends FluentQuerySupport } @Override - public R one() { + public R oneValue() { return findOperation.find(metaData.getType()) .as(resultType) @@ -126,7 +126,7 @@ final class FetchableFluentQueryByPredicate extends FluentQuerySupport } @Override - public R first() { + public R firstValue() { List all = all(); return all.isEmpty() ? null : all.get(0); diff --git a/src/test/java/org/springframework/data/neo4j/integration/imperative/QuerydslNeo4jPredicateExecutorIT.java b/src/test/java/org/springframework/data/neo4j/integration/imperative/QuerydslNeo4jPredicateExecutorIT.java index 3986f7648..f1f42125d 100644 --- a/src/test/java/org/springframework/data/neo4j/integration/imperative/QuerydslNeo4jPredicateExecutorIT.java +++ b/src/test/java/org/springframework/data/neo4j/integration/imperative/QuerydslNeo4jPredicateExecutorIT.java @@ -92,7 +92,7 @@ class QuerydslNeo4jPredicateExecutorIT { void fluentFindOneShouldWork(@Autowired QueryDSLPersonRepository repository) { Predicate predicate = Expressions.predicate(Ops.EQ, firstNamePath, Expressions.asString("Helge")); - Person person = repository.findBy(predicate, q -> q.one()); + Person person = repository.findBy(predicate, q -> q.oneValue()); assertThat(person).isNotNull(); assertThat(person).extracting(Person::getLastName).isEqualTo("Schneider"); @@ -174,7 +174,7 @@ class QuerydslNeo4jPredicateExecutorIT { void fluentFindFirstShouldWork(@Autowired QueryDSLPersonRepository repository) { Predicate predicate = Expressions.TRUE.isTrue(); - Person person = repository.findBy(predicate, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "lastName")).first()); + Person person = repository.findBy(predicate, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "lastName")).firstValue()); assertThat(person).isNotNull(); assertThat(person).extracting(Person::getFirstName).isEqualTo("Helge"); diff --git a/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java b/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java index 522f14e2a..4c2d648b5 100644 --- a/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java +++ b/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java @@ -2679,7 +2679,7 @@ class RepositoryIT { Example example = Example.of(person1, ExampleMatcher.matchingAll().withIgnoreNullValues()); - PersonWithAllConstructor person = repository.findBy(example, q -> q.one()); + PersonWithAllConstructor person = repository.findBy(example, q -> q.oneValue()); assertThat(person).isNotNull(); assertThat(person).isEqualTo(person1); @@ -2759,7 +2759,7 @@ class RepositoryIT { Example example = Example.of(person1, ExampleMatcher.matchingAll().withIgnoreNullValues()); - PersonWithAllConstructor person = repository.findBy(example, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "name")).first()); + PersonWithAllConstructor person = repository.findBy(example, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "name")).firstValue()); assertThat(person).isNotNull(); assertThat(person).isEqualTo(person1);