@PostConstruct public void init() { medicamentoService.setEntityManager(em); if (resultList.isEmpty()) { resultList = medicamentoService.obtenerMedicamentos(this.getPageSize(), primerResult); } }
@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(); }
public void setParametroBusqueda(String parametroBusqueda) { this.parametroBusqueda = parametroBusqueda; this.setResulList(medicamentoService.BuscarMedicamentosPorParametro(parametroBusqueda)); }
public void buscarPorParametro() { this.setResulList(medicamentoService.BuscarMedicamentosPorParametro1(parametroBusqueda)); }
@Override public Medicamento getRowData(String nombre) { return medicamentoService.buscarPorNombreMedicamento(nombre); }