Skip to content

Commit 9a0ed23

Browse files
committed
How did I cause the failure I'm hunting here?
1 parent 02e588e commit 9a0ed23

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,20 @@ void findAllByExamplePageable(Pageable pageRequest, int size, int totalPages, Li
923923
}
924924
}
925925

926+
@Test
927+
void findByExampleWithCollection(){
928+
929+
List<Root> roots = rootRepository.saveAll(List.of(createRoot("one"), createRoot("two")));
930+
931+
Example<Root> example = Example.of(new Root(null, "one", null, null));
932+
933+
Iterable<RootProjection> result = rootRepository.findAll(example);
934+
935+
assertThat(result).contains(roots.get(0));
936+
System.out.println(result);
937+
}
938+
939+
926940
public static Stream<Arguments> findAllByExamplePageableSource() {
927941
return Stream.of( //
928942
Arguments.of(PageRequest.of(0, 3), 3, 34, Arrays.asList("3", "4", "100")), //
@@ -1509,7 +1523,7 @@ interface DummyEntityRepository extends CrudRepository<DummyEntity, Long>, Query
15091523
List<DummyEntity> findByBytes(byte[] bytes);
15101524
}
15111525

1512-
interface RootRepository extends ListCrudRepository<Root, Long> {
1526+
interface RootRepository extends ListCrudRepository<Root, Long>, QueryByExampleExecutor<Root> {
15131527
List<Root> findAllByOrderByIdAsc();
15141528
}
15151529

@@ -1639,6 +1653,10 @@ public String toString() {
16391653
}
16401654
}
16411655

1656+
interface RootProjection {
1657+
String getName();
1658+
}
1659+
16421660
@Table("WITH_DELIMITED_COLUMN")
16431661
static class WithDelimitedColumn {
16441662
@Id Long id;

0 commit comments

Comments
 (0)