Skip to content

Commit fcf767a

Browse files
GH-1911 - Polishing.
This changes the return types of the `CypherdslConditionExecutor` into `Collection` and aligns it with the `CypherdslStatementExecutor` and in the long run with the goal Spring Data Commons has for the `QuerydslPredicateExecutor`. It makes more sense for this new API to align with the desired state instead of something we consider suboptimal.
1 parent 319a84d commit fcf767a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static org.neo4j.cypherdsl.core.Cypher.asterisk;
1919

20+
import java.util.Collection;
2021
import java.util.List;
2122
import java.util.Optional;
2223
import java.util.function.LongSupplier;
@@ -69,7 +70,7 @@ public Optional<T> findOne(Condition condition) {
6970
}
7071

7172
@Override
72-
public Iterable<T> findAll(Condition condition) {
73+
public Collection<T> findAll(Condition condition) {
7374

7475
return this.neo4jOperations.toExecutableQuery(
7576
this.metaData.getType(),
@@ -78,7 +79,7 @@ public Iterable<T> findAll(Condition condition) {
7879
}
7980

8081
@Override
81-
public Iterable<T> findAll(Condition condition, Sort sort) {
82+
public Collection<T> findAll(Condition condition, Sort sort) {
8283

8384
return this.neo4jOperations.toExecutableQuery(
8485
metaData.getType(),
@@ -89,7 +90,7 @@ public Iterable<T> findAll(Condition condition, Sort sort) {
8990
}
9091

9192
@Override
92-
public Iterable<T> findAll(Condition condition, SortItem... sortItems) {
93+
public Collection<T> findAll(Condition condition, SortItem... sortItems) {
9394

9495
return this.neo4jOperations.toExecutableQuery(
9596
this.metaData.getType(),
@@ -100,7 +101,7 @@ public Iterable<T> findAll(Condition condition, SortItem... sortItems) {
100101
}
101102

102103
@Override
103-
public Iterable<T> findAll(SortItem... sortItems) {
104+
public Collection<T> findAll(SortItem... sortItems) {
104105

105106
return this.neo4jOperations.toExecutableQuery(
106107
this.metaData.getType(),

src/main/java/org/springframework/data/neo4j/repository/support/CypherdslConditionExecutor.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.springframework.data.neo4j.repository.support;
1717

18+
import java.util.Collection;
1819
import java.util.Optional;
1920

2021
import org.apiguardian.api.API;
@@ -37,13 +38,13 @@ public interface CypherdslConditionExecutor<T> {
3738

3839
Optional<T> findOne(Condition condition);
3940

40-
Iterable<T> findAll(Condition condition);
41+
Collection<T> findAll(Condition condition);
4142

42-
Iterable<T> findAll(Condition condition, Sort sort);
43+
Collection<T> findAll(Condition condition, Sort sort);
4344

44-
Iterable<T> findAll(Condition condition, SortItem... sortItems);
45+
Collection<T> findAll(Condition condition, SortItem... sortItems);
4546

46-
Iterable<T> findAll(SortItem... sortItems);
47+
Collection<T> findAll(SortItem... sortItems);
4748

4849
Page<T> findAll(Condition condition, Pageable pageable);
4950

0 commit comments

Comments
 (0)