When the following URL is visited, I get fingerprints 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 the following URL there is no page without Spring Data REST fields -
/api/users/4/userPosts
{
"_embedded" : {
"userPosts" : [ {
Both UserRepository and UserPostRepository are paginated JPARepository. As a result, the second URL throws an excess of GC invoice because the number of rows for the returned results is 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 to have a pagination with a second url?
fortm source
share