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

Add offset option in findManyByCondition to support pagination. #172

Closed
leavestylecode opened this issue Jan 5, 2021 · 4 comments
Closed
Milestone

Comments

@leavestylecode
Copy link

I can't finish paging without offset param. Is there have a good resolving method?

@jklingsporn
Copy link
Owner

Hi,
thanks for your message. Indeed, there is no such method yet but there is actually no reason to not have it (I wish Java had default method arguments). However, there is an easy workaround. If you look here it should be easy to implement it on your own:

dao.queryExecutor().findMany(selectQuery(condition).andThen(sel -> sel.limit(offset,limit)));

@jklingsporn jklingsporn changed the title Why no offset in findManyByCondition? Add offset option in findManyByCondition to support pagination. Jan 5, 2021
@leavestylecode
Copy link
Author

ok. Got it! Thanks

@leavestylecode
Copy link
Author

leavestylecode commented Jan 5, 2021

I think the limit field, should add a offset field to match 😄

@jklingsporn
Copy link
Owner

Well not everybody needs offset so I will add a separate method.

@jklingsporn jklingsporn added this to the 6.1.0 milestone Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants