GH-2343 - Adapt to changes in FluentQuery.
See: #2343 Original pull request: #2360.
This commit is contained in:
@@ -110,7 +110,7 @@ final class FetchableFluentQueryByExample<S, R> extends FluentQuerySupport<R> im
|
||||
}
|
||||
|
||||
@Override
|
||||
public R one() {
|
||||
public R oneValue() {
|
||||
|
||||
return findOperation.find(example.getProbeType())
|
||||
.as(resultType)
|
||||
@@ -120,7 +120,7 @@ final class FetchableFluentQueryByExample<S, R> extends FluentQuerySupport<R> im
|
||||
}
|
||||
|
||||
@Override
|
||||
public R first() {
|
||||
public R firstValue() {
|
||||
|
||||
List<R> all = all();
|
||||
return all.isEmpty() ? null : all.get(0);
|
||||
|
||||
@@ -112,7 +112,7 @@ final class FetchableFluentQueryByPredicate<S, R> extends FluentQuerySupport<R>
|
||||
}
|
||||
|
||||
@Override
|
||||
public R one() {
|
||||
public R oneValue() {
|
||||
|
||||
return findOperation.find(metaData.getType())
|
||||
.as(resultType)
|
||||
@@ -126,7 +126,7 @@ final class FetchableFluentQueryByPredicate<S, R> extends FluentQuerySupport<R>
|
||||
}
|
||||
|
||||
@Override
|
||||
public R first() {
|
||||
public R firstValue() {
|
||||
|
||||
List<R> all = all();
|
||||
return all.isEmpty() ? null : all.get(0);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -2679,7 +2679,7 @@ class RepositoryIT {
|
||||
|
||||
Example<PersonWithAllConstructor> 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<PersonWithAllConstructor> 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);
|
||||
|
||||
Reference in New Issue
Block a user