Class SpringDataJpaLazyDataModel<T,ID,R extends org.springframework.data.jpa.repository.JpaRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>>

java.lang.Object
jakarta.faces.model.DataModel<E>
jakarta.faces.model.ListDataModel<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 manages
ID - the type of the id of the entity the repository manages
R -
All Implemented Interfaces:
Serializable, Iterable<T>, org.primefaces.model.SelectableDataModel<T>

public class SpringDataJpaLazyDataModel<T,ID,R extends org.springframework.data.jpa.repository.JpaRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>> extends SpringDataLazyDataModel<T,ID,R>
See Also:
  • Constructor Details

    • SpringDataJpaLazyDataModel

      public SpringDataJpaLazyDataModel(R repository)
  • 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 class SpringDataLazyDataModel<T,ID,R extends org.springframework.data.jpa.repository.JpaRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>>
    • count

      public int count(Map<String,org.primefaces.model.FilterMeta> filterBy)
      Overrides:
      count in class SpringDataLazyDataModel<T,ID,R extends org.springframework.data.jpa.repository.JpaRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>>
    • getSpecification

      @Nullable protected org.springframework.data.jpa.domain.Specification<T> getSpecification(Map<String,org.primefaces.model.FilterMeta> filterBy)
    • getSpecification

      protected org.springframework.data.jpa.domain.Specification<T> getSpecification(org.primefaces.model.FilterMeta filterMeta)
    • getPrimaryKey

      public ID getPrimaryKey(T entity)
      Overrides:
      getPrimaryKey in class SpringDataLazyDataModel<T,ID,R extends org.springframework.data.jpa.repository.JpaRepository<T,ID> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>>
    • getEntityManager

      public jakarta.persistence.EntityManager getEntityManager()
    • setEntityManager

      public void setEntityManager(jakarta.persistence.EntityManager entityManager)