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

Ease creation of QuerySpecs #93

Closed
mlopezFC opened this issue Jun 23, 2024 · 1 comment
Closed

Ease creation of QuerySpecs #93

mlopezFC opened this issue Jun 23, 2024 · 1 comment

Comments

@mlopezFC
Copy link
Member

If I want a QuerySpec that returns everything I need to:

    QuerySpec querySpec = new QuerySpec();
    querySpec.setFirstResult(0);
    querySpec.setMaxResult(Integer.MAX_VALUE);

Maybe it would be better to use something like QuerySpec.withNoRestrictions();

Also it would be great to have a builder pattern to make it easier to build a new instance.

@javier-godoy
Copy link
Member

If I want a QuerySpec that returns everything I need to:

If both firstResult and maxResult are null, it will be a non-paged query:

public List<T> filter(QuerySpec filter) {
if (filter.getFirstResult()==null && filter.getMaxResult()==null) {
return getExecutor().findAll(buildSpecification(filter), buildSort(filter));

Also it would be great to have a builder pattern to make it easier to build a new instance

+1

mlopezFC added a commit that referenced this issue Jun 25, 2024
mlopezFC added a commit that referenced this issue Jul 1, 2024
Make the creation of new QuerySpec instances easier by using chained
Accessors. This make the feature not binary compatible, but given that
we're just returning QuerySpecs instead of void, everything should
compile, thus this is not a breaking change.

Closes #93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants