You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.data.provider.

Class AbstractBackEndDataProvider<T,​F>

    • Constructor Detail

      • AbstractBackEndDataProvider

        public AbstractBackEndDataProvider()
    • Method Detail

      • fetch

        public Stream<T> fetch​(Query<T,​F> query)

        Description copied from interface: DataProvider

        Fetches data from this DataProvider using given query.

        Specified by:

        fetch in interface DataProvider<T,​F>

        Parameters:

        query - given query to request data

        Returns:

        the result of the query request: a stream of data objects, not null

      • size

        public int size​(Query<T,​F> query)

        Description copied from interface: DataProvider

        Gets the amount of data in this DataProvider.

        Specified by:

        size in interface DataProvider<T,​F>

        Parameters:

        query - query with sorting and filtering

        Returns:

        the size of the data provider

      • fetchFromBackEnd

        protected abstract Stream<T> fetchFromBackEnd​(Query<T,​F> query)

        Fetches data from the back end using the given query.

        Parameters:

        query - the query that defines sorting, filtering and paging for fetching the data

        Returns:

        a stream of items matching the query

      • sizeInBackEnd

        protected abstract int sizeInBackEnd​(Query<T,​F> query)

        Counts the number of items available in the back end.

        Parameters:

        query - the query that defines filtering to be used for counting the number of items

        Returns:

        the number of available items

      • setSortOrders

        public void setSortOrders​(List<QuerySortOrder> sortOrders)

        Description copied from interface: BackEndDataProvider

        Sets a list of sort orders to use as the default sorting for this data provider. This overrides the sorting set by any other method that manipulates the default sorting of this data provider.

        The default sorting is used if the query defines no sorting. The default sorting is also used to determine the ordering of items that are considered equal by the sorting defined in the query.

        Specified by:

        setSortOrders in interface BackEndDataProvider<T,​F>

        Parameters:

        sortOrders - a list of sort orders to set, not null

        See Also:

        BackEndDataProvider.setSortOrder(QuerySortOrder)