I have the following query for my JPA application against Postgres DB:
@Query("SELECT c FROM Cacl c WHERE c.name LIKE 'caclId%'")
public Page<Cacl> getCaclIdStartsWith(@Param("caclId") String caclId);
When I start the application I get the following exception:
Error creating bean with name 'caclRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.domain.Page .repositories.CaclReposit...(I'm masking here on purpose)... ory.getCaclIdStartsWith(java.lang.String)
The implication is that the result would not return multiple records. However it should return multiple records. In fact when I run SQL equivalent query:
SELECT * FROM TBL_CACL WHERE NAME LIKE 'SOME_CACL%';
, it works fine and returns multiple rows as I would expect. I assume I am doing something wrong with my syntax but not sure what. Grateful for any insights. Thanks