Questions tagged [pageable]
104 questions
0
votes
0 answers
JPA/Hibernate/Querydsl can't sql order Entity data class name Order
I request Order Index Pageable that contain sort condition example (id, desc)
request url
/orders?page=0&size=20&sort=id,desc
error message
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request…

Jiwhun
- 1
- 3
0
votes
1 answer
PagedResources
I am using Spring Boot REST example. In this I am using RestTemplate to call the endpoint which returns PagedResources> Object. But when calling through RestTemplate, I did not get any contents. However this service is build in…

PAA
- 1
- 46
- 174
- 282
0
votes
0 answers
Show custom response message in Spring boot JPA pagable controller
I have a pageable controller like following. I have used the filter which will give HttpServletResponse depending on the condition. And i want to show all user if only HttpServletResponse status code is 200. Or else i want to show custom…

Suban Dhyako
- 2,436
- 4
- 16
- 38
0
votes
1 answer
Spring pageable force add sorted value
I want to force add sorting parameter to Pageable, even if one is passed. @SortDefault(sort = {"id"}) works well, but only if sorting value is not passed. If is - this annotation is ignored.
How to add "sort by id" even if sorting by other fields is…

B_Osipiuk
- 888
- 7
- 16
0
votes
0 answers
Paging and sorting by enumeration
My service is returning a page of elements, and I want to be able to sort it by many fields.
So far I can sort it by all fields except this enumeration field:
enum ActionStatusEnum {
TO_DO("ToDo"),
ROUGH_DRAFT("Brouillon"),
…

Amine Benhammou
- 1
- 1
0
votes
1 answer
org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Invalid parameter index 2
I am upgrading my application into java 8, hibernate5 and spring 4.
There are some existing JPQL query in which i was using Pageable that is not working afer update.
I am getting below exception
2019-09-03 07:55:18,814 [http-nio-8080-exec-1] WARN …

KESHAV
- 1
- 1
0
votes
1 answer
Unable to override defaults of Pagination in Spring Boot 2.1.6.RELEASE?
I am working on Spring Boot Spring Data Mongo Pageable example. I want to set pagination value default page=1 and size=5, if no one provided any values.
Now when user provided any values, I want Pageable object to use those values and not default…

PAA
- 1
- 46
- 174
- 282
0
votes
0 answers
Spring boot Pageable sort by a parameter that is not in the Domain object
In our application UI, we're displaying a table of contents that shows user information, i.e.
firstName, lastName, email, phoneNumber, role, userType
The last two columns, role and userType are NOT part of the User domain object. They are derived in…

getITdone
- 95
- 2
- 12
0
votes
1 answer
How to sort by map values with Pageable
I have a SpringBoot application with REST controller and I need to do sorting by entity properties including map values.
Here is my entity class:
@Document
data class Event(
@Id
val id: CompoundId,
@Indexed
val timestamp: Instant,
val description:…

Valeriy K.
- 2,616
- 1
- 30
- 53
0
votes
1 answer
Pageable - PageRequest, no spring boot properties for the page, only available for the default-page-size
I already followed the link: Set default page size for JPA Pageable Object, but I only see option to set the page-size like spring.data.web.pageable.default-page-size, but I don't see option to page to any customizable value. I know page should…

PAA
- 1
- 46
- 174
- 282
-1
votes
1 answer
Implementing Page with Filtering
i have this repository, service and controller, and i have no ideea how to solve the error that i m getting in service, any suggestions please? (Type mismatch: cannot convert from List to Page)
String…

Java
- 11
- 2
-1
votes
1 answer
Spring boot - subtraction inside sortBy (Pageable)
Is it possible to subtract two fields(numbers) inside sortBy in pagerequest like this??
PageRequest.of(page, size, Sort.Direction.ASC, "price-discount")
.
This is error i get..
Sort expression 'price-discount: ASC' must only contain property…
user13505963
-1
votes
1 answer
Apply Sorting on the Response - Spring Boot
Actually, I am returning the below response(Page-able Response) and I want to apply the sort on the list,
Response :
{
"body": {
"totalCount": 500,
"success": true,
"data": [
{
"id": 3361,
"displayName":…

Dhruv Tyagi
- 814
- 1
- 9
- 28
-3
votes
2 answers
Pageable in Spring boot
I want to return "ownDemand" as Page of demand. How can I do that
@Override
public Page getDemandbyId(Long id, Pageable pageable) {
Iterable alldemand = demandRepository.findAll();
List ownDemand = new…

junior developer
- 5
- 5