so my interface:
public interface SubmissionRepository extends PagingAndSortingRepository<Submission, Long> {
//all by approval phase
@RestResource(path="byApprovalPhase")
List<Submission> findByApprovalPhase(@Param("approvalPhase") ApprovalPhase approvalPhase);
//paging + sorting
@RestResource(path="byApprovalPhasePaging")
Page<Submission> findByApprovalPhase(@Param("approvalPhase") ApprovalPhase approvalPhase, Pageable pageable);
//all with sorting
@RestResource(path="byApprovalPhaseSorting")
List<Submission> findByApprovalPhase(@Param("approvalPhase") ApprovalPhase approvalPhase, Sort pageable);
}
so I get those methods in json/hal curl -v http://localhost:8080/submissions/search
....
"_links" : {
"findByApprovalPhase" : [ {
"href" : "http://localhost:8080/submissions/search/byApprovalPhase{?approvalPhase}",
"templated" : true
}, {
"href" : "http://localhost:8080/submissions/search/byApprovalPhasePaging{?approvalPhase,page,size,sort}",
"templated" : true
}, {
"href" : "http://localhost:8080/submissions/search/byApprovalPhaseSorting{?approvalPhase}",
"templated" : true
} ]
}
...
but curl -v http://localhost:8080/submissions/search/byApprovalPhasePaging?approvalPhase=PENDING&page=1&size=5
returns default 20 rows. Same thing with sorting - it doesnt work ( no error, just sorting has no effect). Dont know what is missed here.
//edit:
similar thing for localhost:8080/submissions - there are 14 rows total, by default it shows 20.
curl -v http://localhost:8080/submissions?size=1
returns 1st one, but curl -v http://localhost:8080/submissions?page=1&size=1
returns only _links to prev, next.
My repository extends PagingAndSortingRepository..