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 class
static 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()
int
count
(Map<String, FilterMeta> filterBy) Counts the all available data for the given filters.getRowData
(String rowKey) Loads the data for the given parameters.protected void
Methods inherited from class org.primefaces.model.LazyDataModel
getMessage, getPageSize, getRowCount, getRowData, getRowData, getRowIndex, getRowKeyFromConverter, getWrappedData, isRowAvailable, iterator, iterator, recalculateFirst, setPageSize, setRowCount, setRowIndex, setWrappedData
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultLazyDataModel
public DefaultLazyDataModel()For serialization only
-
-
Method Details
-
count
Description copied from class:LazyDataModel
Counts 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 bothrowCount
anddata
within 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:
count
in 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:LazyDataModel
Loads the data for the given parameters.- Specified by:
load
in 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:
getRowData
in interfaceSelectableDataModel<T>
- Overrides:
getRowData
in classLazyDataModel<T>
-
getRowKey
- Specified by:
getRowKey
in interfaceSelectableDataModel<T>
- Overrides:
getRowKey
in classLazyDataModel<T>
-
builder
-