Skip to content

Commit 0fd0c9a

Browse files
committed
Incorporate review feedback.
1 parent ce30dd6 commit 0fd0c9a

File tree

3 files changed

+64
-115
lines changed

3 files changed

+64
-115
lines changed

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

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.junit.jupiter.params.ParameterizedTest;
4343
import org.junit.jupiter.params.provider.Arguments;
4444
import org.junit.jupiter.params.provider.MethodSource;
45+
4546
import org.springframework.beans.factory.annotation.Autowired;
4647
import org.springframework.beans.factory.config.PropertiesFactoryBean;
4748
import org.springframework.context.ApplicationListener;
@@ -51,7 +52,16 @@
5152
import org.springframework.core.io.ClassPathResource;
5253
import org.springframework.dao.IncorrectResultSizeDataAccessException;
5354
import org.springframework.data.annotation.Id;
54-
import org.springframework.data.domain.*;
55+
import org.springframework.data.domain.Example;
56+
import org.springframework.data.domain.ExampleMatcher;
57+
import org.springframework.data.domain.Limit;
58+
import org.springframework.data.domain.Page;
59+
import org.springframework.data.domain.PageRequest;
60+
import org.springframework.data.domain.Pageable;
61+
import org.springframework.data.domain.ScrollPosition;
62+
import org.springframework.data.domain.Slice;
63+
import org.springframework.data.domain.Sort;
64+
import org.springframework.data.domain.Window;
5565
import org.springframework.data.jdbc.core.mapping.AggregateReference;
5666
import org.springframework.data.jdbc.repository.query.Modifying;
5767
import org.springframework.data.jdbc.repository.query.Query;
@@ -913,19 +923,6 @@ void findAllByExamplePageable(Pageable pageRequest, int size, int totalPages, Li
913923
}
914924
}
915925

916-
@Test
917-
void findByExampleWithCollection() {
918-
919-
List<Root> roots = rootRepository.saveAll(List.of(createRoot("one"), createRoot("two")));
920-
921-
Example<Root> example = Example
922-
.of(new Root(null, "one", null, List.of(new Intermediate(null, "peter", null, null))));
923-
924-
Iterable<Root> result = rootRepository.findAll(example);
925-
926-
assertThat(result).contains(roots.get(0));
927-
}
928-
929926
public static Stream<Arguments> findAllByExamplePageableSource() {
930927
return Stream.of( //
931928
Arguments.of(PageRequest.of(0, 3), 3, 34, Arrays.asList("3", "4", "100")), //
@@ -1512,7 +1509,7 @@ interface DummyEntityRepository extends CrudRepository<DummyEntity, Long>, Query
15121509
List<DummyEntity> findByBytes(byte[] bytes);
15131510
}
15141511

1515-
interface RootRepository extends ListCrudRepository<Root, Long>, QueryByExampleExecutor<Root> {
1512+
interface RootRepository extends ListCrudRepository<Root, Long> {
15161513
List<Root> findAllByOrderByIdAsc();
15171514
}
15181515

spring-data-relational/src/main/java/org/springframework/data/relational/repository/query/RelationalExampleMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
*
3939
* @since 2.2
4040
* @author Greg Turnquist
41+
* @author Jens Schauder
4142
*/
4243
public class RelationalExampleMapper {
4344

@@ -78,7 +79,7 @@ private <T> Query getMappedExample(Example<T> example, RelationalPersistentEntit
7879

7980
entity.doWithProperties((PropertyHandler<RelationalPersistentProperty>) property -> {
8081

81-
if (property.isCollectionLike()) {
82+
if (property.isCollectionLike() || property.isMap()) {
8283
return;
8384
}
8485

0 commit comments

Comments
 (0)