Kenmegne
7 days ago 23a46b4be35277e06ec89f48730eeb694e686be8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.megatim.fdxconsultation.core.ifaces.abtracts;
 
import com.megatim.fdxcommons.model.pojo.CriteriaEntityFromView;
import com.megatim.fdxcommons.model.pojo.OrderByDefinition;
import com.megatim.fdxconsultation.dao.ifaces.abstracts.PaginationWithCriteriaEntityDAO;
import java.util.List;
 
/**
 *
 * @author ASUS
 */
public interface PaginationWithCriteriaEntity<T, ID> {
 
    PaginationWithCriteriaEntityDAO<T, ID> paginationWithCriteriaEntityDAO();
 
    public default List<T> findWithPagination(CriteriaEntityFromView criterion, List<String> fetchEagerFields, List<OrderByDefinition> orderByFields, Integer pageNumber, Integer pageSize) throws Exception {
        return paginationWithCriteriaEntityDAO().findWithPagination(criterion, fetchEagerFields, orderByFields,  pageNumber, pageSize);
    }
    
    public default List<T> findAll(CriteriaEntityFromView criterion, List<String> fetchEagerFields, List<OrderByDefinition> orderByFields) throws Exception {
        return paginationWithCriteriaEntityDAO().findAll(criterion, fetchEagerFields, orderByFields);
    }
 
    public default Long count(CriteriaEntityFromView criterion) throws Exception {
        return paginationWithCriteriaEntityDAO().count(criterion);
    }
}