Skip to content

Commit 5840ea6

Browse files
committed
GH-2343 - Adapt to changes in FluentQuery.
1 parent b45d62c commit 5840ea6

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
@@ -2657,7 +2657,7 @@ void findOneByExampleFluent(@Autowired PersonRepository repository) {
26572657

26582658
Example<PersonWithAllConstructor> example = Example.of(person1,
26592659
ExampleMatcher.matchingAll().withIgnoreNullValues());
2660-
PersonWithAllConstructor person = repository.findBy(example, q -> q.one());
2660+
PersonWithAllConstructor person = repository.findBy(example, q -> q.oneValue());
26612661

26622662
assertThat(person).isNotNull();
26632663
assertThat(person).isEqualTo(person1);
@@ -2737,7 +2737,7 @@ void findFirstByExample(@Autowired PersonRepository repository) {
27372737

27382738
Example<PersonWithAllConstructor> example = Example.of(person1,
27392739
ExampleMatcher.matchingAll().withIgnoreNullValues());
2740-
PersonWithAllConstructor person = repository.findBy(example, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "name")).first());
2740+
PersonWithAllConstructor person = repository.findBy(example, q -> q.sortBy(Sort.by(Sort.Direction.DESC, "name")).firstValue());
27412741

27422742
assertThat(person).isNotNull();
27432743
assertThat(person).isEqualTo(person1);

0 commit comments

Comments
 (0)