Package org.primefaces.model
Class DefaultLazyDataModel<T>
java.lang.Object
javax.faces.model.DataModel<T>
org.primefaces.model.LazyDataModel<T>
org.primefaces.model.DefaultLazyDataModel<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,SelectableDataModel<T>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
Fields inherited from class org.primefaces.model.LazyDataModel
rowKeyConverter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> DefaultLazyDataModel.Builder<T>builder()intcount(Map<String, FilterMeta> filterBy) Counts the all available data for the given filters.getRowData(String rowKey) Loads the data for the given parameters.protected voidMethods inherited from class org.primefaces.model.LazyDataModel
getMessage, getPageSize, getRowCount, getRowData, getRowIndex, getRowKeyFromConverter, getWrappedData, isRowAvailable, iterator, iterator, loadOne, recalculateFirst, setPageSize, setRowCount, setRowIndex, setWrappedDataMethods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultLazyDataModel
public DefaultLazyDataModel()For serialization only
-
-
Method Details
-
count
Description copied from class:LazyDataModelCounts the all available data for the given filters. In case of SQL, this would execute a "SELECT COUNT ... WHERE ...". In case you dont use SQL and receive bothrowCountanddatawithin a single call, this method should just return0. You must callLazyDataModel.recalculateFirst(int, int, int)andLazyDataModel.setRowCount(int)in yourLazyDataModel.load(int, int, java.util.Map, java.util.Map)method.- Specified by:
countin classLazyDataModel<T>- Parameters:
filterBy- a map with all filter information (only relevant for DataTable, not for eg DataView)- Returns:
- the data count
-
load
public List<T> load(int first, int pageSize, Map<String, SortMeta> sortBy, Map<String, FilterMeta> filterBy) Description copied from class:LazyDataModelLoads the data for the given parameters.- Specified by:
loadin classLazyDataModel<T>- Parameters:
first- the first entrypageSize- the page sizesortBy- a map with all sort information (only relevant for DataTable, not for eg DataView)filterBy- a map with all filter information (only relevant for DataTable, not for eg DataView)- Returns:
- the data
-
sort
-
filter
-
getRowData
- Specified by:
getRowDatain interfaceSelectableDataModel<T>- Overrides:
getRowDatain classLazyDataModel<T>
-
getRowKey
- Specified by:
getRowKeyin interfaceSelectableDataModel<T>- Overrides:
getRowKeyin classLazyDataModel<T>
-
builder
-