Questions tagged [pageable]

104 questions
0
votes
0 answers

Java 11 - Springboot JPA - Pagination with Offset

In my springboot 2.7.14 project I need to execute a query with a projection, specification and pagination. I already tried the library "specification-with-projection" but it doesn't seem to fit my case because the query is still retrieving all the…
Alexxxx
  • 19
  • 4
0
votes
0 answers

Pageable with multiple field sort

Payload "country_code":["IT","FR","JP"],"ordina" : {"country_code":"DESC"}}" If don't put ordina, is ok, but if I want sort my output receive an exception Class CountryRepo //Remove @RepositoryRestResource below to disable auto REST api: …
0
votes
0 answers

Page.getTotalElements() returns the number of total data in table not the number of result of query

hi Iam using spring boot, JPA I used Pageable objects to do Pagination and when I get each Page, I got totalElements by using getTotalElements() I expected to get the number of searching result, but I got the total number of table's record. for…
0
votes
0 answers

Using @ParameterObject or @PageableAsQueryParam to set description about Pageable in swagger doc

right now, I am making swagger doc. swagger img I want to customize that description about page, size and sort. @GetMapping("/test") public page getTest(@ParameterObject Pageable pageable) { return page } this is my brief…
lizard
  • 1
  • 1
0
votes
1 answer

400 if Pageable cannot be parsed

Recently I was informed about a bug. The tester executed the following request: curl -X 'GET' 'http://zones:26081/zones/vehicles-by-day?date=2023-05-20&page=0&size=10&sort=string' And got 500 error in…
ka3ak
  • 2,435
  • 2
  • 30
  • 57
0
votes
1 answer

How to change Pageable defaulte maxSize behaviour?

everyone. I have a controller with Specification and Pageable parameters. If I need to return data form db in a usual way - everything works fine. I get my data by 20 size pages. Like this: ............ "totalElements": 2612, …
Vitaliy
  • 25
  • 7
0
votes
0 answers

How to fetch the attributes of Joined Column parameter in the Entity class

I am kind new to Spring Boot and trying to how JPA and hibernate works to make my filters and pagination work. Here is my Entity class: @Entity @Table(name="V_BOOK") @Getter @Setter public class BookView implements…
0
votes
1 answer

Can Spring Data Pageables be used with raw JDBC queries?

Spring Boot here. I've seen Pageable used with repository methods like so: @Repository public interface SomeThingRepository extends JpaRepository { List findByClientName(String clientName, Pageable…
hotmeatballsoup
  • 385
  • 6
  • 58
  • 136
0
votes
0 answers

What can i do for Pagination infer arguments error

`Hi i am using pagination to display data but i got an error showing cannot infer arguments ...can anyone help me through it.Thanks in advance ``` private Paginator getOrganizationInfoPaginator( Organization…
0
votes
0 answers

With RAML can I 'append' properties to my response body with a trait?

I understand how to 'wrap' a response object via a RAML trait. But I need to 'append' some properties to the response body via a trait. My specific example is a 'pageable' trait which defines the query parameters for limit and offset. But I also…
MarkE
  • 123
  • 8
0
votes
0 answers

Using a List with Pageable in a (custom) Query throws Mixed Parameter Strategies Exception

I would like to understand why my custom query returns either a Mixed Parameter Strategies Exception or a Column... Not Found in ORDER BY... (when removing pageable below). // I need to use this request in order to return screenshots that matches…
newenpoi
  • 1
  • 1
0
votes
0 answers

how to JPA Pageable object merge or using List type in method parameter?

first, I'm not a person who uses the english. so i'm writing with the help of a translator.. please understand even if it's awkward. i'm trying to using PagingAndSortingRepository in MVC pattern but i don't know how to merge pageable object or using…
0
votes
0 answers

OpenAPI shows string as default value for string in sort field of pageable

OpenAPI shows string as default value for string in sort field of pageable, why is the default being set to value "string" for "sort". Since we would prefer that end users don't set a value for Pageable while executing calls via the Swagger UI…
Rpj
  • 5,348
  • 16
  • 62
  • 122
0
votes
1 answer

InvalidPathException while sorting with org.springframework.data.domain.Pageable

I am trying to sort my table's content on the backend side, so I am sending org.springframework.data.domain.Pageable object to controller. It arrives correctly, but at the repository I am getting org.hibernate.hql.internal.ast.InvalidPathException.…
szelelaci
  • 163
  • 1
  • 12
0
votes
1 answer

some problem with mock test for specification class

I'm new to programming, I want to make tests for my Specification class, but I can't figure out where I should start...how to approach this test? public class MySpecification implements Specification { MyRequest request; …