Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Slice based implementation of PagingAndSortingRepository [DATAJPA-734] #1107

Closed
spring-projects-issues opened this issue Jun 4, 2015 · 2 comments
Assignees
Labels
status: declined type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jun 4, 2015

Brandon Vulaj opened DATAJPA-734 and commented

This may belong in DATAREST, but I figured I'd start here.

As has already been recognized, sometimes the extra count( * ) query can be incredibly expensive, depending on the database engine. Currently, within Spring Data REST, there is no way to re-map an entity's collection resource to utilize a method that returns a Slice instead of a Page. Of course you can write your own methods that do this, but this does not affect the collection resource for SDR.

SO Reference: http://stackoverflow.com/questions/29946477/disable-row-count-of-findall-collection-resource-in-spring-data-rest


Issue Links:

  • DATAJPA-961 Slice support on JpaSpecificationExecutor

2 votes, 3 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 4, 2016

Thomas Darimont commented

As a workaround you could also just declare a method like:

Slice<BusinessObject> findAllBy(Pageable pageable);

on your Repository interface.
This would trigger a org.springframework.data.jpa.repository.query.JpaQueryExecution.SlicedExecution
which would avoid the count query by using the query derivation mechanism without a filter

@gregturn
Copy link
Member

@gregturn gregturn commented Jun 7, 2022

In general we aren't going to create more variations of repository definitions. It leads to too much maintenance.

If you prefer the Slice-based abstraction, you are free to create your own base repository and extensions. Spring Data JPA will work just fine with it and Thomas mentioned up above. But we aren't going to managed that change ourselves.

@gregturn gregturn closed this as completed Jun 7, 2022
@gregturn gregturn self-assigned this Jun 7, 2022
@gregturn gregturn added the status: declined label Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants