diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/service/CityRepository.java b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/service/CityRepository.java index 281e75977e..4281956641 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/service/CityRepository.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/service/CityRepository.java @@ -19,6 +19,7 @@ package sample.data.jpa.service; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import sample.data.jpa.domain.City; @@ -26,9 +27,11 @@ import sample.data.jpa.domain.City; @RepositoryRestResource(collectionResourceRel = "citys", path = "cities") interface CityRepository extends PagingAndSortingRepository { - Page findByNameContainingAndCountryContainingAllIgnoringCase(String name, - String country, Pageable pageable); + Page findByNameContainingAndCountryContainingAllIgnoringCase( + @Param("name") String name, @Param("country") String country, + Pageable pageable); - City findByNameAndCountryAllIgnoringCase(String name, String country); + City findByNameAndCountryAllIgnoringCase(@Param("name") String name, + @Param("country") String country); }