Search in sources :

Example 1 with AreaCriteria

use of de.symeda.sormas.api.infrastructure.area.AreaCriteria in project SORMAS-Project by hzi-braunschweig.

the class AreasGrid method setLazyDataProvider.

public void setLazyDataProvider() {
    DataProvider<AreaDto, AreaCriteria> dataProvider = DataProvider.fromFilteringCallbacks(query -> FacadeProvider.getAreaFacade().getIndexList(query.getFilter().orElse(null), query.getOffset(), query.getLimit(), query.getSortOrders().stream().map(sortOrder -> new SortProperty(sortOrder.getSorted(), sortOrder.getDirection() == SortDirection.ASCENDING)).collect(Collectors.toList())).stream(), query -> {
        return (int) FacadeProvider.getAreaFacade().count(query.getFilter().orElse(null));
    });
    setDataProvider(dataProvider);
    setSelectionMode(SelectionMode.NONE);
}
Also used : AreaCriteria(de.symeda.sormas.api.infrastructure.area.AreaCriteria) SortProperty(de.symeda.sormas.api.utils.SortProperty) AreaDto(de.symeda.sormas.api.infrastructure.area.AreaDto)

Aggregations

AreaCriteria (de.symeda.sormas.api.infrastructure.area.AreaCriteria)1 AreaDto (de.symeda.sormas.api.infrastructure.area.AreaDto)1 SortProperty (de.symeda.sormas.api.utils.SortProperty)1