Skip to content

Commit 607a45f

Browse files
committed
GH-2343 - Adapt to changes in FluentQuery.
See: #2343 Original pull request: #2360.
1 parent de18721 commit 607a45f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByExample.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public FetchableFluentQuery<R> project(Collection<String> properties) {
110110
}
111111

112112
@Override
113-
public R one() {
113+
public R oneValue() {
114114

115115
return findOperation.find(example.getProbeType())
116116
.as(resultType)
@@ -120,7 +120,7 @@ public R one() {
120120
}
121121

122122
@Override
123-
public R first() {
123+
public R firstValue() {
124124

125125
List<R> all = all();
126126
return all.isEmpty() ? null : all.get(0);

src/main/java/org/springframework/data/neo4j/repository/query/FetchableFluentQueryByPredicate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public FetchableFluentQuery<R> project(Collection<String> properties) {
112112
}
113113

114114
@Override
115-
public R one() {
115+
public R oneValue() {
116116

117117
return findOperation.find(metaData.getType())
118118
.as(resultType)
@@ -126,7 +126,7 @@ public R one() {
126126
}
127127

128128
@Override
129-
public R first() {
129+
public R firstValue() {
130130

131131
List<R> all = all();
132132
return all.isEmpty() ? null : all.get(0);

src/test/java/org/springframework/data/neo4j/integration/imperative/QuerydslNeo4jPredicateExecutorIT.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected static void setupData(@Autowired BookmarkCapture bookmarkCapture) {
9292
void fluentFindOneShouldWork(@Autowired QueryDSLPersonRepository repository) {
9393

9494
Predicate predicate = Expressions.predicate(Ops.EQ, firstNamePath, Expressions.asString("Helge"));
95-
Person person = repository.findBy(predicate, q -> q.one());
95+
Person person = repository.findBy(predicate, q -> q.oneValue());
9696

9797
assertThat(person).isNotNull();
9898
assertThat(person).extracting(Person::getLastName).isEqualTo("Schneider");
@@ -174,7 +174,7 @@ void fluentStreamProjectingShouldWork(@Autowired QueryDSLPersonRepository reposi
174174
void fluentFindFirstShouldWork(@Autowired QueryDSLPersonRepository repository) {
175175

176176
Predicate predicate = Expressions.TRUE.isTrue();
177-
Person person = repository.findBy(predicate, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "lastName")).first());
177+
Person person = repository.findBy(predicate, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "lastName")).firstValue());
178178

179179
assertThat(person).isNotNull();
180180
assertThat(person).extracting(Person::getFirstName).isEqualTo("Helge");

src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ void findOneByExampleFluent(@Autowired PersonRepository repository) {
26792679

26802680
Example<PersonWithAllConstructor> example = Example.of(person1,
26812681
ExampleMatcher.matchingAll().withIgnoreNullValues());
2682-
PersonWithAllConstructor person = repository.findBy(example, q -> q.one());
2682+
PersonWithAllConstructor person = repository.findBy(example, q -> q.oneValue());
26832683

26842684
assertThat(person).isNotNull();
26852685
assertThat(person).isEqualTo(person1);
@@ -2759,7 +2759,7 @@ void findFirstByExample(@Autowired PersonRepository repository) {
27592759

27602760
Example<PersonWithAllConstructor> example = Example.of(person1,
27612761
ExampleMatcher.matchingAll().withIgnoreNullValues());
2762-
PersonWithAllConstructor person = repository.findBy(example, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "name")).first());
2762+
PersonWithAllConstructor person = repository.findBy(example, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "name")).firstValue());
27632763

27642764
assertThat(person).isNotNull();
27652765
assertThat(person).isEqualTo(person1);

0 commit comments

Comments
 (0)