Пример #1
0
  @Override
  public List<Medicamento> load(
      int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> map) {
    int end = first + pageSize;

    QuerySortOrder order = QuerySortOrder.DESC;
    if (sortOrder == SortOrder.DESCENDING) {
      order = QuerySortOrder.DESC;
    }
    Map<String, Object> _filters = new HashMap<String, Object>();
    /*_filters.put(BussinesEntity_.type.getName(), getType()); //Filtro por defecto
    _filters.putAll(filters);*/

    QueryData<Medicamento> qData = medicamentoService.find(first, end, sortField, order, _filters);
    this.setRowCount(qData.getTotalResultCount().intValue());
    this.setResulList(qData.getResult());
    Collections.sort(resultList);
    return qData.getResult();
  }
  @Override
  public List<BussinesEntityType> load(
      int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> filters) {

    log.info("load results for ..." + first + ", " + pageSize);

    int end = first + pageSize;

    QuerySortOrder order = QuerySortOrder.ASC;
    if (sortOrder == SortOrder.DESCENDING) {
      order = QuerySortOrder.DESC;
    }
    Map<String, Object> _filters = new HashMap<String, Object>();
    /*_filters.put(BussinesEntityType_.name, getSelectedBussinesEntityType()); //Filtro por defecto
    _filters.putAll(filters);*/

    QueryData<BussinesEntityType> qData =
        bussinesEntityTypeService.find(first, end, sortField, order, _filters);
    this.setRowCount(qData.getTotalResultCount().intValue());
    return qData.getResult();
  }