java - Pagination in Spring Data Rest for nested resources -
java - Pagination in Spring Data Rest for nested resources -
when below url visited, paginations in response
/api/userposts/ { "_links" : { "self" : { "href" : "/api/userposts{?page,size,sort}", "templated" : true }, "next" : { "href" : api/userposts?page=1&size=20{&sort}", "templated" : true } }, "_embedded" : { "userposts" : [ { ...
however when visiting next url, there no pagination out of box spring info rest -
/api/users/4/userposts { "_embedded" : { "userposts" : [ {
both userrepository , userpostrepository jparepository pagination. result, sec url throwing gc overhead exceeded error since row count results returned huge.
@repositoryrestresource(excerptprojection = userprojection.class) public interface userrepository extends baserepository<user, integer>, userrepositorycustom { } public interface userpostrepository extends baserepository<userpost, long> { } @norepositorybean public interface baserepository<t, n extends serializable> extends jparepository<t, n>, querydslpredicateexecutor<t> { }
any way have pagination sec url ?
java spring spring-data spring-data-rest
Comments
Post a Comment