public interface VaadinSpringDataHelpers extends Serializable
| Modifier and Type | Method and Description |
|---|---|
static <T> com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback<T,Void> |
fromPagingRepository(org.springframework.data.repository.PagingAndSortingRepository<T,?> repo)
Binds all items from a given paging Spring Data repository to
Grid. |
static org.springframework.data.domain.Sort |
toSpringDataSort(com.vaadin.flow.data.provider.Query<?,?> vaadinQuery)
Translates given Query object from a Vaadin component to Spring Data Sort
object.
|
static org.springframework.data.domain.PageRequest |
toSpringPageRequest(com.vaadin.flow.data.provider.Query<?,?> vaadinQuery)
Creates a Spring Data
PageRequest based on the Vaadin
Query object. |
static org.springframework.data.domain.Sort toSpringDataSort(com.vaadin.flow.data.provider.Query<?,?> vaadinQuery)
Can be used as a helper when making a lazy data binding from a Vaadin component to a Spring Data based back-end. The method expects Vaadin sort data to include the property name.
vaadinQuery - the Vaadin Query object passed by the componentstatic org.springframework.data.domain.PageRequest toSpringPageRequest(com.vaadin.flow.data.provider.Query<?,?> vaadinQuery)
PageRequest based on the Vaadin
Query object. Takes sort into account, based on properties.vaadinQuery - the query object from Vaadin componentPageRequest that can be passed for Spring Data based
back-endstatic <T> com.vaadin.flow.data.provider.CallbackDataProvider.FetchCallback<T,Void> fromPagingRepository(org.springframework.data.repository.PagingAndSortingRepository<T,?> repo)
Grid. Usage example:
grid.setItems(fromPagingRepository(repo));
T - the type of items to bindrepo - the repository where the results should be fetched fromGrid.Copyright © 2021 Vaadin Ltd. All Rights Reserved.