Package org.joinfaces.primefaces
Class SpringDataJpaLazyDataModel<T,ID,R extends JpaRepository<T,ID> & JpaSpecificationExecutor<T>>
java.lang.Object
jakarta.faces.model.DataModel<T>
org.primefaces.model.LazyDataModel<T>
org.joinfaces.primefaces.SpringDataLazyDataModel<T,ID,R>
org.joinfaces.primefaces.SpringDataJpaLazyDataModel<T,ID,R>
- Type Parameters:
T
- the domain type the repository managesID
- the type of the id of the entity the repository managesR
- the type of the repository interface
- All Implemented Interfaces:
Serializable
,Iterable<T>
,org.primefaces.model.SelectableDataModel<T>
public class SpringDataJpaLazyDataModel<T,ID,R extends JpaRepository<T,ID> & JpaSpecificationExecutor<T>>
extends SpringDataLazyDataModel<T,ID,R>
Primefaces
LazyDataModel
implementation which wraps a Spring Data JPA Repository
.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Fields inherited from class org.primefaces.model.LazyDataModel
rowKeyConverter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getPrimaryKey
(T entity) protected Specification<T>
getSpecification
(Map<String, org.primefaces.model.FilterMeta> filterBy) protected Specification<T>
getSpecification
(org.primefaces.model.FilterMeta filterMeta) load
(int first, int pageSize, Map<String, org.primefaces.model.SortMeta> sortBy, Map<String, org.primefaces.model.FilterMeta> filterBy) void
setEntityManager
(EntityManager entityManager) Methods inherited from class org.joinfaces.primefaces.SpringDataLazyDataModel
getEntityConverter, getEntityInformation, getIdClass, getPageable, getPageable, getRowData, getRowKey, getSort, registerResult, setEntityConverter, setEntityInformation, setIdClass, setPrimaryKeyDeserializer, setPrimaryKeySerializer
Methods inherited from class org.primefaces.model.LazyDataModel
getMessage, getPageSize, getRowCount, getRowData, getRowIndex, getRowKeyFromConverter, getWrappedData, isRowAvailable, iterator, iterator, loadOne, recalculateFirst, setPageSize, setRowCount, setRowIndex, setWrappedData
Methods inherited from class jakarta.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
-
SpringDataJpaLazyDataModel
-
-
Method Details
-
load
public List<T> load(int first, int pageSize, Map<String, org.primefaces.model.SortMeta> sortBy, Map<String, org.primefaces.model.FilterMeta> filterBy) - Overrides:
load
in classSpringDataLazyDataModel<T,
ID, R extends JpaRepository<T, ID> & JpaSpecificationExecutor<T>>
-
count
- Overrides:
count
in classSpringDataLazyDataModel<T,
ID, R extends JpaRepository<T, ID> & JpaSpecificationExecutor<T>>
-
getSpecification
@Nullable protected Specification<T> getSpecification(Map<String, org.primefaces.model.FilterMeta> filterBy) -
getSpecification
-
getPrimaryKey
- Overrides:
getPrimaryKey
in classSpringDataLazyDataModel<T,
ID, R extends JpaRepository<T, ID> & JpaSpecificationExecutor<T>>
-
getEntityManager
-
setEntityManager
-