Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
32 views

in Controller if PageNumber and PageSize is given larger than int it crashes how can i write constraints not to have PageNumber and Pagesize larger than some reasonable number? i tried finding ...
Vako Davitashvili's user avatar
0 votes
0 answers
41 views

I have simple entity. When I invoke findPageableCommunityAccess from below examples I'm receiving result that look like CommunityAccess (full object) instead CommunityAccessProjection. Do Projections ...
Robert's user avatar
  • 337
1 vote
1 answer
286 views

I need to combine data from two different DTOs (or entities) into a single pageable result. **The Problem ** I have two lists of DTOs, both of which are fetched separately from the database and ...
yoyo's user avatar
  • 111
1 vote
0 answers
37 views

On my app, pageable methods are run successfully and got Status 200 ok on Postman checking, however content is empty, and we can not see the list of adverts on Postman. We just have Status 200 ok and ...
Duygu Yilmaz's user avatar
0 votes
1 answer
174 views

I have an endpoint that uses pagination and Pageable and returns various information, I don't need all this information and I wanted to remove/add some. Is there a way to do this? @GetMapping ...
Iago Antunes's user avatar
0 votes
0 answers
95 views

Cannot properly mock the method in repository which requires passing Pageable. I tried everything I could find. PLEASE HELP. So I cannot mock findAllByTypeContainsAndSexLike method TEST CLASS: @...
Artem's user avatar
  • 11
1 vote
1 answer
828 views

Code: @NoRepositoryBean public interface AbstractRepository <M extends AbstractModel> extends MongoRepository<M, String> { Page<M> findAll(Pageable pageable); Page<M> ...
Ramon Jales's user avatar
-1 votes
1 answer
367 views

Actually i'm using Slice to pagination in queries in Cassandra. My repository is declared like this: @Repository public interface MovementsRepository<T> extends CassandraRepository<Movements, ...
Italo Vieira 's user avatar
0 votes
0 answers
87 views

Unable to fetch and update all the rows having source_channel as SourceChannels.DRIVER_REFERRAL_CHANNEL. batchSize = 2 Page<Lead> driverReferralLeads = repository....
Dev's user avatar
  • 567
0 votes
0 answers
1k views

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 ...
GyeongEun Kim's user avatar
0 votes
0 answers
2k views

right now, I am making swagger doc. swagger img I want to customize that description about page, size and sort. @GetMapping("/test") public page<TestDTO> getTest(@ParameterObject ...
lizard's user avatar
  • 1
0 votes
1 answer
244 views

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 ...
ka3ak's user avatar
  • 3,411
0 votes
1 answer
514 views

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: ..........
Vitaliy's user avatar
  • 25
0 votes
1 answer
115 views

Spring Boot here. I've seen Pageable used with repository methods like so: @Repository public interface SomeThingRepository extends JpaRepository<SomeThing, Long> { List<SomeThing> ...
hotmeatballsoup's user avatar
1 vote
0 answers
811 views

How can I use Spring Data JPA to find results in two repositories using Pageable? Consider that we have 2 repositories: the first repository has 5 rows matching a certain condition. The second ...
Saron Ciupe's user avatar
0 votes
1 answer
348 views

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....
szelelaci's user avatar
  • 303
0 votes
1 answer
499 views

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&...
Marzepanio Tortus's user avatar
0 votes
2 answers
867 views

repository: @Repository public interface PostRepository extends PagingAndSortingRepository<Post, Long> { @Query(value = "SELECT p.postComments FROM Post p WHERE p.webId = ?1") ...
moze's user avatar
  • 392
0 votes
1 answer
2k views

I am curently trying to get a list of paged blobs from azure, but I don't really know how and I am kind of stuck. I have this method that is Pageable (it acces the blobs for a specific student, based ...
CuriousCat11's user avatar
1 vote
1 answer
467 views

if I request for a Page of results from my DB without any ordering provided val page1 = repository.findAll(PageRequest.of(1,10)) val page2 = repository.findAll(PageRequest.of(2,10)) Could page1 and ...
edu's user avatar
  • 478
1 vote
1 answer
3k views

If I send a request from Spring application: public ResponseEntity<RestResponsePage<Result>> readDocs( Pageable pageable ) { HttpHeaders requestHeaders = new HttpHeaders(); ...
tryingHard's user avatar
  • 2,134
0 votes
0 answers
518 views

i have a data problem for my code: PeopleSpec peopleSpec = new PeopleSpec(req.getSearchFilters(), jsonReqRes.getOrder()); int currentPage = req.getCurrentPage() - 1; int elementForPage = ...
Alex's user avatar
  • 131
-1 votes
1 answer
182 views

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<UtenteDto>...
Java's user avatar
  • 21
1 vote
0 answers
294 views

I basically need to create an ordered pagination through a list of objects. I ended up creating a method that returns the pagination, although the ordering is still not working, I would like to know ...
Diogo Zucchi's user avatar
4 votes
1 answer
2k views

I'm requesting paged and sorted data from my database, specified via Pageable with following repository API: org.springframework.data.jpa.repository.JpaSpecificationExecutor.findAll(Specification<...
PAX's user avatar
  • 1,186
0 votes
1 answer
1k views

I'm looking at some old code and I'm trying to re-write it however I encountered a problem. This is the old code that works perfectly fine: public Page<SearchResult> search(String text, int ...
JustQuest's user avatar
  • 299
0 votes
1 answer
871 views

I'm using spring to develop an application using sqlite as a database, but I'm having a problem implementing pagination in the repository's findAll(Pageable pageable) method. For this implementation I'...
Nuno Rolo's user avatar
0 votes
1 answer
364 views

I am working on a spring boot app where I am getting pageable response and then I want to take that pageable response array to parse it to a list of some DTO. Here's my function: public Object ...
rudeTool's user avatar
  • 616
0 votes
0 answers
1k views

I have a rest controller that takes pageable as a parameter @GetMapping(value = "/user", produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE) public BaseResponse ...
Abhishek's user avatar
  • 690
0 votes
1 answer
84 views

while the code I wrote works, because the page have couple of these absolute elements. it takes a couple milliseconds to hide them, so users who have low-end hardware will sometimes see the absolute ...
l3est's user avatar
  • 417
0 votes
0 answers
269 views

I have defined the named native query in orm.xml which maps to the method declared in repository interface Student Repository @Query(nativeQuery = true) public List<DeptStuInfo> ...
user avatar
1 vote
1 answer
3k views

I have a weird situation where if I set the page size to less than the total size of the results, it errors out. In my repo, have a giant query enclosed in a WITH to keep things simple, so paging ...
Mankind1023's user avatar
  • 7,788
1 vote
2 answers
571 views

I'm very new to Spring. I'm trying to get a Page to return that to my front end. The AppUser has a lazy association with Role entity. I'm getting a failed to lazily initialize a collection of role ...
GaetanK's user avatar
  • 11
4 votes
1 answer
1k views

I implemented pageable functionality into Criteria API query and I noticed increased memory usage during query execution. I also used spring-data-jpa method query to return same result, but there ...
Gilgalad's user avatar
0 votes
1 answer
62 views

@Entity @Table(name="blogs") public class Blog { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 300) private ...
Dimitar's user avatar
  • 25
3 votes
1 answer
4k views

Using a Pageable parameter in a Spring Data JPA Repository allows for specifying fields to sort by like: PageRequest.of(0, 50, Sort.by("field1", "field2")), which would sort by ...
dukethrash's user avatar
  • 1,539
0 votes
2 answers
5k views

I'm converting a Page to a new one by using PageImpl class, but the totalpages attribute has the default value 0. I would like to set totalPages to a specific number. Is it possible to change it? code ...
Amr EL HAMMADI's user avatar
0 votes
0 answers
2k views

I have the following Rest controller method: @GetMapping public Page<CompanyDto> findAllCompanies(@RequestParam(value = "name", required = false) String name, Pageable pageable, ...
alexanoid's user avatar
  • 26.1k
0 votes
2 answers
3k views

In my PSQL DB, I have two objects stored and I would like to retrieve each item on their separate page/slice. I am trying to achieve this by passing in the following Page objects: PageRequest.of(0,1) ...
mr nooby noob's user avatar
0 votes
1 answer
123 views

I'm getting the following error when pageable's page is 3 or higher (with values 1 or 2 it works). The error is coming from a call to mongorepository. Failed to convert from type [java.lang.String] to ...
Jonas Machado's user avatar
3 votes
3 answers
1k views

I came across the following problem... I have three entities: @Entity class Contract { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @ManyToOne ...
wojtek1902's user avatar
0 votes
0 answers
1k views

So my question is simple, I am getting a Slice<Object> from database using pageable. Then I need to filter it based on some parameters(fe. status), so as usual I'm doing something like this: ...
developer1's user avatar
1 vote
1 answer
546 views

I recently ran into this problem. I have a product that has a list of values in relation to volume. Example: enter image description here Entities : public class Price implements Serializable, ...
SnejOK's user avatar
  • 117
0 votes
1 answer
319 views

I'm having a problem with Kendo .Pagable. We have a webapplication that displays entries in a grid. The user can choose between 25, 50, 100, 200 entries per site. But whenever the user enters the ...
Raphael Müller's user avatar
0 votes
0 answers
321 views

i have a problem. I'm trying to do custom query with filtering by date usin time stamp, but im using Pageable and it adds to query after comma id desc limit and it causing error like below. I dont ...
wiler121's user avatar
0 votes
1 answer
2k views

(I'm using Micronaut) I have a list of students and I want to sort it by name. I am using Pageable and sort as query parameters http://localhost:8080/admin/students?page=0&size=10&sort=name,...
marhg's user avatar
  • 697
7 votes
1 answer
3k views

I have written a really simple test for a method in my controller using Mockito @Test fun `get items based on category ID`() { val pageable: Pageable = PageRequest.of(5, 50) controller.get(10, ...
Nick Div's user avatar
  • 5,656
0 votes
2 answers
880 views

I want to use WebClient to retrieve a page from another microservice. When I directly request the microservice using Postman, the response includes the type attribute among other fields in the content ...
Gykonik's user avatar
  • 706
-1 votes
1 answer
2k views

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 ...
user avatar
3 votes
2 answers
7k views

I searched everywhere for an example of a Spring piece of code using simultaneously these 3 JPA concepts, very important when querying : filtering - using Example, ExampleMatcher paging - using ...
MS13's user avatar
  • 415