vaadin / vaadin/framework

DataProvider supporting count and fetch in one request - for WebServices and spring-data page feature

Open
#8,816 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

I tired to implement a DataProvider which supports counting and fetching in one request, e.g. for querying webservices or using spring-datas Page feature.

I've created a class implementing FetchCallback and CountCallback. It checks if the query changed, so that a new request is needed and
stores the Page result, so that after a count call the fetch call is not passed to the backend.

The Problem is, that a grid does the first call to CountCallback.count(Query query) with a limit of Integer.MAX_VALUE which returns the whole database.

If the later limit, offset and sortOrders would be also passed to count, then integrating spring-data would be much easier.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining DataProvider, FetchCallback, CountCallback, and Query, then reproduce the initial CountCallback.count(Query) call with a limit of Integer.MAX_VALUE. The work is complete when count receives the relevant limit, offset, and sortOrders so web-service and spring-data Page integrations can avoid fetching the whole database.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.